Merge pull request #6368 from Icinga/fix/program-options-parsing-6365

Fix program option parsing
This commit is contained in:
Michael Friedrich 2018-06-15 16:09:13 +02:00 committed by GitHub
commit eb1f37905d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View 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;
}