diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2025-08-27 14:55:35 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2025-08-27 14:55:35 -0300 |
| commit | 9ac9d23f4164fc7e1eeea8a3e8d4e453dade51ab (patch) | |
| tree | a2283e372f1ef05bdba8d9d41787ad872d09ce6e /lua.c | |
| parent | 1b0f943da7dfb25987456a77259edbeea0b94edc (diff) | |
| download | lua-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.c | 3 |
1 files changed, 2 insertions, 1 deletions
| @@ -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 '-' */ |
