From 193dc14edbaa2b6a243754aec53939aa6aeb7cfd Mon Sep 17 00:00:00 2001 From: Magnus Jacobsson Date: Sun, 4 Oct 2020 20:50:53 +0200 Subject: [PATCH] Explicitly specify -? as an option in gc --- cmd/tools/gc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/tools/gc.c b/cmd/tools/gc.c index 840fbb5f6..cafe39d3f 100644 --- a/cmd/tools/gc.c +++ b/cmd/tools/gc.c @@ -89,7 +89,7 @@ static void init(int argc, char *argv[]) unsigned int c; opterr = 0; - while ((c = getopt(argc, argv, "necCaDUrsv")) != -1) { + while ((c = getopt(argc, argv, "necCaDUrsv?")) != -1) { switch (c) { case 'e': flags |= EDGES; @@ -123,7 +123,7 @@ static void init(int argc, char *argv[]) gtype = UNDIRECTED; break; case '?': - if (optopt == '?') + if (optopt == '\0') usage(0); else { fprintf(stderr, "gc: option -%c unrecognized\n", -- 2.40.0