summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2017-08-29 13:48:49 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2017-08-29 13:48:49 +0200
commit55af51c66d0dae27d188974820c4a7d53dd0be55 (patch)
tree7d23fa741d3be4784c25aa9629c70429c575aada
parent238ff98bb85adfb5563d10b37ea4c33fef3af2f2 (diff)
hush: reuse "OPTIND=..." string
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--shell/hush.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/shell/hush.c b/shell/hush.c
index ceb8cbb0a..8e0022531 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -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) {