##// END OF EJS Templates
chg: be stricter about checking invocation of `serve` command...
Pulkit Goyal -
r45107:1e459ac4 default
parent child Browse files
Show More
@@ -374,8 +374,7 b' static int runinstructions(struct cmdser'
374 374
375 375 /*
376 376 * Test whether the command is unsupported or not. This is not designed to
377 * cover all cases. But it's fast, does not depend on the server and does
378 * not return false positives.
377 * cover all cases. But it's fast, does not depend on the server.
379 378 */
380 379 static int isunsupported(int argc, const char *argv[])
381 380 {
@@ -388,7 +387,12 b' static int isunsupported(int argc, const'
388 387 for (i = 0; i < argc; ++i) {
389 388 if (strcmp(argv[i], "--") == 0)
390 389 break;
391 if (i == 0 && strcmp("serve", argv[i]) == 0)
390 /*
391 * there can be false positives but no false negative
392 * we cannot assume `serve` will always be first argument
393 * because global options can be passed before the command name
394 */
395 if (strcmp("serve", argv[i]) == 0)
392 396 state |= SERVE;
393 397 else if (strcmp("-d", argv[i]) == 0 ||
394 398 strcmp("--daemon", argv[i]) == 0)
General Comments 0
You need to be logged in to leave comments. Login now