]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/run/run.c
Merge pull request #27113 from keszybz/variable-expansion-rework
[thirdparty/systemd.git] / src / run / run.c
index 2f5ec9c73b76a7072d0f54e3b6f24da20575d3ff..41570bf12ebbea796bf373d8127ab37f267ac712 100644 (file)
@@ -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) {