[git commit] hush: if we did match "LINENO" or "OPTIND", stop further comparisons

Denys Vlasenko vda.linux at googlemail.com
Fri Apr 6 12:57:53 UTC 2018


commit: https://git.busybox.net/busybox/commit/?id=00bd76728d44901a260f2dcdbeed52b3c85d6b6b
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master

function                                             old     new   delta
handle_changed_special_names                          99     101      +2

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 shell/hush.c | 8 ++++++--
 1 file 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
 	}
 }


More information about the busybox-cvs mailing list