diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2017-07-17 21:31:17 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2017-07-17 21:31:17 +0200 |
commit | 6b48e1f1212300464c17c8317f5faddf6b414a4c (patch) | |
tree | 82df1620bf3da44cfa1db4c06066bf7a477215e9 | |
parent | b95ee96e7528554fc3ee2c48fbd59d75c59148db (diff) | |
download | busybox-w32-6b48e1f1212300464c17c8317f5faddf6b414a4c.tar.gz busybox-w32-6b48e1f1212300464c17c8317f5faddf6b414a4c.tar.bz2 busybox-w32-6b48e1f1212300464c17c8317f5faddf6b414a4c.zip |
hush: forgot to emit error on (failing) second "readonly VAR=VAL"
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | shell/hush.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/shell/hush.c b/shell/hush.c index 2125e757d..1961c9830 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -2074,6 +2074,7 @@ static int set_local_var(char *str, | |||
2074 | char *eq_sign; | 2074 | char *eq_sign; |
2075 | int name_len; | 2075 | int name_len; |
2076 | 2076 | ||
2077 | //bb_error_msg("set_local_var('%s',%d,%d,%d)", str, flg_export, local_lvl, flg_read_only); | ||
2077 | eq_sign = strchr(str, '='); | 2078 | eq_sign = strchr(str, '='); |
2078 | if (!eq_sign) { /* not expected to ever happen? */ | 2079 | if (!eq_sign) { /* not expected to ever happen? */ |
2079 | free(str); | 2080 | free(str); |
@@ -2090,8 +2091,7 @@ static int set_local_var(char *str, | |||
2090 | 2091 | ||
2091 | /* We found an existing var with this name */ | 2092 | /* We found an existing var with this name */ |
2092 | if (cur->flg_read_only) { | 2093 | if (cur->flg_read_only) { |
2093 | if (!flg_read_only) | 2094 | bb_error_msg("%s: readonly variable", str); |
2094 | bb_error_msg("%s: readonly variable", str); | ||
2095 | free(str); | 2095 | free(str); |
2096 | return -1; | 2096 | return -1; |
2097 | } | 2097 | } |
@@ -9459,7 +9459,6 @@ static int FAST_FUNC builtin_readonly(char **argv) | |||
9459 | } | 9459 | } |
9460 | #endif | 9460 | #endif |
9461 | 9461 | ||
9462 | |||
9463 | #if ENABLE_HUSH_UNSET | 9462 | #if ENABLE_HUSH_UNSET |
9464 | /* http://www.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#unset */ | 9463 | /* http://www.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#unset */ |
9465 | static int FAST_FUNC builtin_unset(char **argv) | 9464 | static int FAST_FUNC builtin_unset(char **argv) |