Browse Source

node: fix argument parsing with -p arg

node -p would cause an access violation.

Fixes test\message\stdin_messages.js on Windows.
v0.11.11-release
Alexis Campailla 11 years ago
committed by Timothy J Fontaine
parent
commit
14d6df8702
  1. 4
      src/node.cc

4
src/node.cc

@ -2867,7 +2867,9 @@ static void ParseArgs(int* argc,
fprintf(stderr, "%s: %s requires an argument\n", argv[0], arg);
exit(9);
}
} else if (argv[index + 1] != NULL && argv[index + 1][0] != '-') {
} else if ((index + 1 < nargs) &&
argv[index + 1] != NULL &&
argv[index + 1][0] != '-') {
args_consumed += 1;
eval_string = argv[index + 1];
if (strncmp(eval_string, "\\-", 2) == 0) {

Loading…
Cancel
Save