X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=src%2Frun%2Frun.c;h=41570bf12ebbea796bf373d8127ab37f267ac712;hb=208a59c15fd41f87248a1a981e558acd3de5e47b;hp=2f5ec9c73b76a7072d0f54e3b6f24da20575d3ff;hpb=2ed7a221fafb25eea937c4e86fb88ee501dba51e;p=thirdparty%2Fsystemd.git diff --git a/src/run/run.c b/src/run/run.c index 2f5ec9c73b7..41570bf12eb 100644 --- a/src/run/run.c +++ b/src/run/run.c @@ -246,6 +246,9 @@ static int parse_argv(int argc, char *argv[]) { assert(argc >= 0); assert(argv); + /* Resetting to 0 forces the invocation of an internal initialization routine of getopt_long() + * that checks for GNU extensions in optstring ('-' or '+' at the beginning). */ + optind = 0; while ((c = getopt_long(argc, argv, "+hrH:M:E:p:tPqGdSu:", options, NULL)) >= 0) switch (c) {