summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/getopt.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/getopt.c b/lib/getopt.c
index fd12a886ec..847830c22b 100644
--- a/lib/getopt.c
+++ b/lib/getopt.c
@@ -64,6 +64,11 @@ int getopt(int argc, char *argv[], const char *optstring)
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;