Skip to content

Commit

Permalink
force_set_var(): Allow emmpty value to unset variable, as intended
Browse files Browse the repository at this point in the history
Signed-off-by: Richard T Bonhomme <[email protected]>
  • Loading branch information
TinCanTech committed May 17, 2024
1 parent a0f1238 commit 12560ce
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions easyrsa3/easyrsa
Original file line number Diff line number Diff line change
Expand Up @@ -4417,6 +4417,8 @@ force_set_var() {
esac
# Guard unset with '|| die', just in case
unset -v "$1" || die "force_set_var - unset '$1'"
# Allow emmpty value to unset variable
[ "$2" ] || return 0
set_var "$1" "$2" && return
die "force_set_var - set_var '$*'"
} # => force_set_var()
Expand Down

0 comments on commit 12560ce

Please sign in to comment.