mirror of
https://github.com/lua/lua.git
synced 2026-07-25 07:29:05 +00:00
Bug: error with option '--' without a script
This commit is contained in:
3
lua.c
3
lua.c
@@ -302,7 +302,8 @@ static int collectargs (char **argv, int *first) {
|
||||
case '-': /* '--' */
|
||||
if (argv[i][2] != '\0') /* extra characters after '--'? */
|
||||
return has_error; /* invalid option */
|
||||
*first = i + 1;
|
||||
/* if there is a script name, it comes after '--' */
|
||||
*first = (argv[i + 1] != NULL) ? i + 1 : 0;
|
||||
return args;
|
||||
case '\0': /* '-' */
|
||||
return args; /* script "name" is '-' */
|
||||
|
||||
Reference in New Issue
Block a user