mirror of
https://github.com/lua/lua
synced 2026-09-26 16:17:11 +03:00
lua option '--' may not be followed by script
This commit is contained in:
parent
942c10a5e3
commit
f65d1f9e02
2 changed files with 7 additions and 5 deletions
3
lua.c
3
lua.c
|
|
@ -303,7 +303,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