]> granicus.if.org Git - clang/commitdiff
Driver: '-' is parsed as an input.
authorDaniel Dunbar <daniel@zuster.org>
Thu, 12 Mar 2009 08:44:47 +0000 (08:44 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Thu, 12 Mar 2009 08:44:47 +0000 (08:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66784 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/OptTable.cpp

index 00a949f086b26fe9f2241fb5a5fbd698e89cfe8d..b2d14ca27f693e5cbb67fa7ddc494c95feeae62d 100644 (file)
@@ -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) {