[git commit] hush: smaller code in !READONLY configs

Denys Vlasenko vda.linux at googlemail.com
Mon Jul 17 19:19:53 UTC 2017


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

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 shell/hush.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/shell/hush.c b/shell/hush.c
index a689863..2125e75 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -9347,11 +9347,14 @@ static int helper_export_local(char **argv,
 				}
 			}
 # if ENABLE_HUSH_LOCAL
-			if (exp == 0 && ro == 0 /* local? */
-			 && var && var->func_nest_level == lvl
+			/* Is this "local" bltin? */
+			if (exp == 0
+			IF_HUSH_READONLY(&& ro == 0) /* in !READONLY config, always true */
 			) {
-				/* "local x=abc; ...; local x" - ignore second local decl */
-				continue;
+				if (var && var->func_nest_level == lvl) {
+					/* "local x=abc; ...; local x" - ignore second local decl */
+					continue;
+				}
 			}
 # endif
 			/* Exporting non-existing variable.


More information about the busybox-cvs mailing list