mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-31 22:25:30 +00:00
Bug 685025 - Shell should be able to read from stdin. (r=brendan)
--HG-- extra : rebase_source : 9ddc8e09ddb00baa50bccef395330f846a2ce531
This commit is contained in:
parent
3803a0a40b
commit
29d140647f
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user