summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko2018-07-18 16:12:23 +0200
committerDenys Vlasenko2018-07-18 16:12:23 +0200
commite36a5894bd24a28b3529998bb7d0f87d7f5eb61b (patch)
tree85e2ee2e616035aefe458e886af2c211e2755257
parent2e71101e31b8b421cee0107c4136d68b65e3a5d8 (diff)
downloadbusybox-e36a5894bd24a28b3529998bb7d0f87d7f5eb61b.zip
busybox-e36a5894bd24a28b3529998bb7d0f87d7f5eb61b.tar.gz
hush: reduce indentation, no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--shell/hush.c52
1 files changed, 25 insertions, 27 deletions
diff --git a/shell/hush.c b/shell/hush.c
index da10a09..92c79b8 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -2423,35 +2423,33 @@ static void set_vars_and_save_old(char **strings)
char *eq;
eq = strchr(*s, '=');
- if (eq) {
- var_pp = get_ptr_to_local_var(*s, eq - *s);
- if (var_pp) {
- var_p = *var_pp;
- if (var_p->flg_read_only) {
- char **p;
- bb_error_msg("%s: readonly variable", *s);
- /*
- * "VAR=V BLTIN" unsets VARs after BLTIN completes.
- * If VAR is readonly, leaving it in the list
- * after asssignment error (msg above)
- * causes doubled error message later, on unset.
- */
- debug_printf_env("removing/freeing '%s' element\n", *s);
- free(*s);
- p = s;
- do { *p = p[1]; p++; } while (*p);
- goto next;
- }
- /* below, set_local_var() with nest level will
- * "shadow" (remove) this variable from
- * global linked list.
- */
- }
- debug_printf_env("%s: env override '%s'/%u\n", __func__, *s, G.var_nest_level);
- set_local_var(*s, (G.var_nest_level << SETFLAG_VARLVL_SHIFT) | SETFLAG_EXPORT);
- } else if (HUSH_DEBUG) {
+ if (HUSH_DEBUG && !eq)
bb_error_msg_and_die("BUG in varexp4");
+ var_pp = get_ptr_to_local_var(*s, eq - *s);
+ if (var_pp) {
+ var_p = *var_pp;
+ if (var_p->flg_read_only) {
+ char **p;
+ bb_error_msg("%s: readonly variable", *s);
+ /*
+ * "VAR=V BLTIN" unsets VARs after BLTIN completes.
+ * If VAR is readonly, leaving it in the list
+ * after asssignment error (msg above)
+ * causes doubled error message later, on unset.
+ */
+ debug_printf_env("removing/freeing '%s' element\n", *s);
+ free(*s);
+ p = s;
+ do { *p = p[1]; p++; } while (*p);
+ goto next;
+ }
+ /* below, set_local_var() with nest level will
+ * "shadow" (remove) this variable from
+ * global linked list.
+ */
}
+ debug_printf_env("%s: env override '%s'/%u\n", __func__, *s, G.var_nest_level);
+ set_local_var(*s, (G.var_nest_level << SETFLAG_VARLVL_SHIFT) | SETFLAG_EXPORT);
s++;
next: ;
}