summaryrefslogtreecommitdiff
path: root/common/cli_hush.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2023-05-04 11:49:30 -0400
committerTom Rini <trini@konsulko.com>2023-05-04 11:49:30 -0400
commit7f30eec1779b8f641b9563a1dab6a6865916ec01 (patch)
tree9d0b296416d6820d45cfa24bdebe1ef81ef44b1c /common/cli_hush.c
parentbfce695104d59a8570ce0a7cbd75d3728117eb5d (diff)
parent0d734df4a459f01fdf1e62512fb28b28022cb6a9 (diff)
Merge branch '2023-05-03-assorted-updates-and-fixes'
- Various typo fixes, pass -Werror to host tools builds, bdi cleanups, fix hush and local variables, a FSL PCI fix and correct some python in one of the tests.
Diffstat (limited to 'common/cli_hush.c')
-rw-r--r--common/cli_hush.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/common/cli_hush.c b/common/cli_hush.c
index 1ad7a509dfa..171069f5f49 100644
--- a/common/cli_hush.c
+++ b/common/cli_hush.c
@@ -2171,12 +2171,18 @@ int set_local_var(const char *s, int flg_export)
* NAME=VALUE format. So the first order of business is to
* split 's' on the '=' into 'name' and 'value' */
value = strchr(name, '=');
- if (value == NULL || *(value + 1) == 0) {
+ if (!value) {
free(name);
return -1;
}
*value++ = 0;
+ if (!*value) {
+ unset_local_var(name);
+ free(name);
+ return 0;
+ }
+
for(cur = top_vars; cur; cur = cur->next) {
if(strcmp(cur->name, name)==0)
break;