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-00bd76728d44901a260f2dcdbeed52b3c85d6b6b.tar.gz
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)
&& name_len == 6
) {
#if ENABLE_HUSH_LINENO_VAR
- if (strncmp(name, "LINENO", 6) == 0)
+ if (strncmp(name, "LINENO", 6) == 0) {
G.lineno_var = NULL;
+ return;
+ }
#endif
#if ENABLE_HUSH_GETOPTS
- if (strncmp(name, "OPTIND", 6) == 0)
+ if (strncmp(name, "OPTIND", 6) == 0) {
G.getopt_count = 0;
+ return;
+ }
#endif
}
}