common: cli_hush: Restore clear local variable support
authorStefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Mon, 3 Apr 2023 13:50:00 +0000 (15:50 +0200)
committerTom Rini <trini@konsulko.com>
Wed, 3 May 2023 22:30:46 +0000 (18:30 -0400)
commit930ef109928969fa17b8ccf2a05aa4aeff10f3e3
tree7d29d44d8dcee0ff2081d043eae3e476f9d621a5
parentd30fbabadebd8b08e2a509a86ff6d4b59ed89f8a
common: cli_hush: Restore clear local variable support

The u-boot hush shell doesn’t support the unset command to clear a
variable and therefore an empty value ("c=") should be a valid value
for the set_local_var function to clear the variable. This partial
reverts commit aa722529635c ("common: cli_hush: avoid dead code") and
only checks for a `=` in the string. Additionally explicit call the
unset_local_var function to remove the variable if the value is empty.

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
common/cli_hush.c