aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2017-07-17 21:19:53 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2017-07-17 21:19:53 +0200
commitb95ee96e7528554fc3ee2c48fbd59d75c59148db (patch)
treebf1d23f4f4172d59ecf38001c1ccc509f38b1af2
parent1e660422b16510f8bcdb764d632bb1da391c4a35 (diff)
downloadbusybox-w32-b95ee96e7528554fc3ee2c48fbd59d75c59148db.tar.gz
busybox-w32-b95ee96e7528554fc3ee2c48fbd59d75c59148db.tar.bz2
busybox-w32-b95ee96e7528554fc3ee2c48fbd59d75c59148db.zip
hush: smaller code in !READONLY configs
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--shell/hush.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/shell/hush.c b/shell/hush.c
index a68986329..2125e757d 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -9347,11 +9347,14 @@ static int helper_export_local(char **argv,
9347 } 9347 }
9348 } 9348 }
9349# if ENABLE_HUSH_LOCAL 9349# if ENABLE_HUSH_LOCAL
9350 if (exp == 0 && ro == 0 /* local? */ 9350 /* Is this "local" bltin? */
9351 && var && var->func_nest_level == lvl 9351 if (exp == 0
9352 IF_HUSH_READONLY(&& ro == 0) /* in !READONLY config, always true */
9352 ) { 9353 ) {
9353 /* "local x=abc; ...; local x" - ignore second local decl */ 9354 if (var && var->func_nest_level == lvl) {
9354 continue; 9355 /* "local x=abc; ...; local x" - ignore second local decl */
9356 continue;
9357 }
9355 } 9358 }
9356# endif 9359# endif
9357 /* Exporting non-existing variable. 9360 /* Exporting non-existing variable.