Do not use argv[0] while parsing command line.

When using jwasm with `JWASM=/path/to/jwasm -h` argv[0] will be
replaced with JWASM variable value. It leads to incorrect behaviour on
NIX systems because `/` acts as a switch character while parsing
command line options.
This commit is contained in:
Ilya V. Matveychikov 2016-09-14 23:24:50 +03:00
parent 644f39971f
commit 4d3b8e80f4

2
main.c
View File

@ -103,7 +103,7 @@ int main( int argc, char **argv )
#endif
/* ParseCmdLine() returns NULL if no source file name has been found (anymore) */
while ( ParseCmdline( (const char **)argv, &numArgs ) ) {
while ( ParseCmdline( (const char **)&argv[1], &numArgs ) ) {
numFiles++;
write_logo();
#if WILDCARDS