aboutsummaryrefslogtreecommitdiff
path: root/lua.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2025-08-27 14:55:35 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2025-08-27 14:55:35 -0300
commit9ac9d23f4164fc7e1eeea8a3e8d4e453dade51ab (patch)
treea2283e372f1ef05bdba8d9d41787ad872d09ce6e /lua.c
parent1b0f943da7dfb25987456a77259edbeea0b94edc (diff)
downloadlua-9ac9d23f4164fc7e1eeea8a3e8d4e453dade51ab.tar.gz
lua-9ac9d23f4164fc7e1eeea8a3e8d4e453dade51ab.tar.bz2
lua-9ac9d23f4164fc7e1eeea8a3e8d4e453dade51ab.zip
Bug: error with option '--' without a 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 4a90e55d..8055b70f 100644
--- a/lua.c
+++ b/lua.c
@@ -302,7 +302,8 @@ static int collectargs (char **argv, int *first) {
302 case '-': /* '--' */ 302 case '-': /* '--' */
303 if (argv[i][2] != '\0') /* extra characters after '--'? */ 303 if (argv[i][2] != '\0') /* extra characters after '--'? */
304 return has_error; /* invalid option */ 304 return has_error; /* invalid option */
305 *first = i + 1; 305 /* if there is a script name, it comes after '--' */
306 *first = (argv[i + 1] != NULL) ? i + 1 : 0;
306 return args; 307 return args;
307 case '\0': /* '-' */ 308 case '\0': /* '-' */
308 return args; /* script "name" is '-' */ 309 return args; /* script "name" is '-' */