aboutsummaryrefslogtreecommitdiff
path: root/lua.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2025-07-08 15:40:59 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2025-07-08 15:40:59 -0300
commitf65d1f9e02d891733d4ff1cf8d4bc91291e0098e (patch)
tree4307126a0f0cd6c864b548929f0a879e25589062 /lua.c
parent942c10a5e33811a08a290ec15031c950a6d17c99 (diff)
downloadlua-f65d1f9e02d891733d4ff1cf8d4bc91291e0098e.tar.gz
lua-f65d1f9e02d891733d4ff1cf8d4bc91291e0098e.tar.bz2
lua-f65d1f9e02d891733d4ff1cf8d4bc91291e0098e.zip
lua option '--' may not be followed by script
Diffstat (limited to 'lua.c')
-rw-r--r--lua.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lua.c b/lua.c
index a90bf29b..66fb74b7 100644
--- a/lua.c
+++ b/lua.c
@@ -303,7 +303,8 @@ static int collectargs (char **argv, int *first) {
303 case '-': /* '--' */ 303 case '-': /* '--' */
304 if (argv[i][2] != '\0') /* extra characters after '--'? */ 304 if (argv[i][2] != '\0') /* extra characters after '--'? */
305 return has_error; /* invalid option */ 305 return has_error; /* invalid option */
306 *first = i + 1; 306 /* if there is a script name, it comes after '--' */
307 *first = (argv[i + 1] != NULL) ? i + 1 : 0;
307 return args; 308 return args;
308 case '\0': /* '-' */ 309 case '\0': /* '-' */
309 return args; /* script "name" is '-' */ 310 return args; /* script "name" is '-' */