← Commit list

55af51c66

Denys Vlasenko
Denys Vlasenko
2017-08-29
SUCCESS Duration: 143s

Subject

hush: reuse "OPTIND=..." string

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

shell/hush.c+2 -1
@@ -2218,7 +2218,8 @@ static int set_local_var(char *str, unsigned flags)
if (name_len == 4 && cur->varstr[0] == 'P' && cur->varstr[1] == 'S')
cmdedit_update_prompt();
#if ENABLE_HUSH_GETOPTS
- if (strncmp(cur->varstr, "OPTIND=", 7) == 0)
+ /* defoptindvar is a "OPTIND=..." constant string */
+ if (strncmp(cur->varstr, defoptindvar, 7) == 0)
G.getopt_count = 0;
#endif
if (cur->flg_export) {