]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/nspawn/nspawn.c
Merge pull request #26887 from yuwata/proc-cmdline-filter-arguments
[thirdparty/systemd.git] / src / nspawn / nspawn.c
index 8abb01679101625e92e7aacbf7989bc9a7294fc0..ce95b10b1cee17f636f914feb10194b8f8520272 100644 (file)
@@ -815,6 +815,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, "+hD:u:abL:M:jS:Z:qi:xp:nUE:P", options, NULL)) >= 0)
                 switch (c) {