diff options
Diffstat (limited to 'llvm/lib/Support/CommandLine.cpp')
-rw-r--r-- | llvm/lib/Support/CommandLine.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp index 7da3862302c..18492e2a189 100644 --- a/llvm/lib/Support/CommandLine.cpp +++ b/llvm/lib/Support/CommandLine.cpp @@ -1306,8 +1306,8 @@ bool CommandLineParser::ParseCommandLineOptions(int argc, // option is another positional argument. If so, treat it as an argument, // otherwise feed it to the eating positional. ArgName = StringRef(argv[i] + 1); - // Eat leading dashes. - while (!ArgName.empty() && ArgName[0] == '-') + // Eat second dash. + if (!ArgName.empty() && ArgName[0] == '-') ArgName = ArgName.substr(1); Handler = LookupOption(*ChosenSubCommand, ArgName, Value); @@ -1318,8 +1318,8 @@ bool CommandLineParser::ParseCommandLineOptions(int argc, } else { // We start with a '-', must be an argument. ArgName = StringRef(argv[i] + 1); - // Eat leading dashes. - while (!ArgName.empty() && ArgName[0] == '-') + // Eat second dash. + if (!ArgName.empty() && ArgName[0] == '-') ArgName = ArgName.substr(1); Handler = LookupOption(*ChosenSubCommand, ArgName, Value); |