do not mix --help' with --'

This commit is contained in:
Roberto Ierusalimschy 2003-03-24 09:40:01 -03:00
parent 30a411ab3c
commit 80bac182db

6
lua.c
View File

@ -1,5 +1,5 @@
/* /*
** $Id: lua.c,v 1.119 2003/03/17 13:01:48 roberto Exp roberto $ ** $Id: lua.c,v 1.120 2003/03/19 21:15:18 roberto Exp roberto $
** Lua stand-alone interpreter ** Lua stand-alone interpreter
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -310,6 +310,10 @@ static int handle_argv (char *argv[], int *interactive) {
if (argv[i][0] != '-') break; /* not an option? */ if (argv[i][0] != '-') break; /* not an option? */
switch (argv[i][1]) { /* option */ switch (argv[i][1]) { /* option */
case '-': { /* `--' */ case '-': { /* `--' */
if (argv[i][2] != '\0') {
print_usage();
return 1;
}
i++; /* skip this argument */ i++; /* skip this argument */
goto endloop; /* stop handling arguments */ goto endloop; /* stop handling arguments */
} }