mirror of
https://github.com/lua/lua
synced 2026-09-29 04:35:58 +03:00
Bug: error with option '--' without a script
This commit is contained in:
parent
1b0f943da7
commit
9ac9d23f41
2 changed files with 8 additions and 5 deletions
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 '-' */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue