]> granicus.if.org Git - icinga2/commitdiff
Fix program option parsing 6368/head
authorMichael Insel <michael@insel.email>
Tue, 12 Jun 2018 17:02:48 +0000 (19:02 +0200)
committerMichael Insel <michael@insel.email>
Tue, 12 Jun 2018 17:02:48 +0000 (19:02 +0200)
This fixes the program option parsing.

lib/cli/clicommand.cpp

index ece65d4e61403bdde8452e86360c14a480afee2e..069597ad915b48466a0a567efb1db3e0c214e980 100644 (file)
@@ -186,7 +186,7 @@ bool CLICommand::ParseCommand(int argc, char **argv, po::options_description& vi
                std::vector<String>::size_type i;
                int k;
                for (i = 0, k = 1; i < vname.size() && k < argc; i++, k++) {
-                       if (strncmp(argv[k], "--", 2) == 0) {
+                       if (strncmp(argv[k], "-", 1) == 0 || strncmp(argv[k], "--", 2) == 0) {
                                i--;
                                continue;
                        }