Bug 685025 - Shell should be able to read from stdin. (r=brendan)

--HG--
extra : rebase_source : 9ddc8e09ddb00baa50bccef395330f846a2ce531
This commit is contained in:
Chris Leary 2011-09-14 17:00:59 -07:00
parent 3803a0a40b
commit 29d140647f

View File

@ -376,12 +376,9 @@ OptionParser::parseArgs(int inputArgc, char **argv)
for (size_t i = 1; i < argc; ++i) {
char *arg = argv[i];
Result r;
if (arg[0] == '-' && optionsAllowed) {
/* Note: solo dash option is actually a 'stdin' argument. */
if (arg[0] == '-' && arg[1] != '\0' && optionsAllowed) {
/* Option. */
size_t arglen = strlen(arg);
if (arglen < 2) /* Do not permit solo dash option. */
return error("Invalid dash option");
Option *opt;
if (arg[1] == '-') {
/* Long option. */
@ -402,6 +399,7 @@ OptionParser::parseArgs(int inputArgc, char **argv)
/* Argument. */
r = handleArg(argc, argv, &i, &optionsAllowed);
}
switch (r) {
case Okay:
break;