diff --git a/lib/getopt.c b/lib/getopt.c index fd12a88..847830c 100644 --- a/lib/getopt.c +++ b/lib/getopt.c @@ -64,6 +64,11 @@ while(1) { debug("optindex: %d nonopts: %d optind: %d\n", optindex, nonopts, optind); + if (optindex == 1 && argv[optind] && !strcmp(argv[optind], "--")) { + optind++; + return -1; + } + /* first put nonopts to the end */ while (optind + nonopts < argc && *argv[optind] != '-') { int i;