aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Driver/OptTable.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Driver/OptTable.cpp b/lib/Driver/OptTable.cpp
index 00a949f086..b2d14ca27f 100644
--- a/lib/Driver/OptTable.cpp
+++ b/lib/Driver/OptTable.cpp
@@ -124,8 +124,8 @@ Arg *OptTable::ParseOneArg(const ArgList &Args, unsigned &Index,
unsigned IndexEnd) const {
const char *Str = Args.getArgString(Index);
- // Anything that doesn't start with '-' is an input.
- if (Str[0] != '-')
+ // Anything that doesn't start with '-' is an input, as is '-' itself.
+ if (Str[0] != '-' || Str[1] == '\0')
return new PositionalArg(getOption(OPT_INPUT), Index++);
for (unsigned j = OPT_UNKNOWN + 1; j < LastOption; ++j) {