handle missing classpath or jar file name gracefully

This commit is contained in:
Joel Dice 2012-08-13 08:36:36 -06:00
parent fa5d76b43e
commit 2abc4e28a5

View File

@ -172,9 +172,11 @@ main(int ac, const char** av)
if (strcmp(av[i], "-cp") == 0 if (strcmp(av[i], "-cp") == 0
or strcmp(av[i], "-classpath") == 0) or strcmp(av[i], "-classpath") == 0)
{ {
if (i + 1 == ac) usageAndExit(av[0]);
classpath = av[++i]; classpath = av[++i];
} else if (strcmp(av[i], "-jar") == 0) } else if (strcmp(av[i], "-jar") == 0)
{ {
if (i + 1 == ac) usageAndExit(av[0]);
jar = av[++i]; jar = av[++i];
} else if (strncmp(av[i], "-X", 2) == 0 } else if (strncmp(av[i], "-X", 2) == 0
or strncmp(av[i], "-D", 2) == 0) or strncmp(av[i], "-D", 2) == 0)