aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2018-04-06 14:57:53 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2018-04-06 14:57:53 +0200
commit00bd76728d44901a260f2dcdbeed52b3c85d6b6b (patch)
tree3fbcc2f0c16cf9ad626b3718cf42a4d769685815
parentcf079ffe1c26c2d42a902a60696b20a262e92d87 (diff)
downloadbusybox-w32-00bd76728d44901a260f2dcdbeed52b3c85d6b6b.tar.gz
busybox-w32-00bd76728d44901a260f2dcdbeed52b3c85d6b6b.tar.bz2
busybox-w32-00bd76728d44901a260f2dcdbeed52b3c85d6b6b.zip
hush: if we did match "LINENO" or "OPTIND", stop further comparisons
function old new delta handle_changed_special_names 99 101 +2 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--shell/hush.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/shell/hush.c b/shell/hush.c
index 7b59b0ff9..971a16aff 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -2134,12 +2134,16 @@ static void handle_changed_special_names(const char *name, unsigned name_len)
2134 && name_len == 6 2134 && name_len == 6
2135 ) { 2135 ) {
2136#if ENABLE_HUSH_LINENO_VAR 2136#if ENABLE_HUSH_LINENO_VAR
2137 if (strncmp(name, "LINENO", 6) == 0) 2137 if (strncmp(name, "LINENO", 6) == 0) {
2138 G.lineno_var = NULL; 2138 G.lineno_var = NULL;
2139 return;
2140 }
2139#endif 2141#endif
2140#if ENABLE_HUSH_GETOPTS 2142#if ENABLE_HUSH_GETOPTS
2141 if (strncmp(name, "OPTIND", 6) == 0) 2143 if (strncmp(name, "OPTIND", 6) == 0) {
2142 G.getopt_count = 0; 2144 G.getopt_count = 0;
2145 return;
2146 }
2143#endif 2147#endif
2144 } 2148 }
2145} 2149}