From 4d3b8e80f407dcb0c957efd2f28d0814fa1a2084 Mon Sep 17 00:00:00 2001 From: "Ilya V. Matveychikov" Date: Wed, 14 Sep 2016 23:24:50 +0300 Subject: [PATCH] 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. --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index 19fa125..cc98c6e 100644 --- a/main.c +++ b/main.c @@ -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