Update command and add check for edge-case.
This commit is contained in:
parent
8d92719522
commit
7729d5e3ac
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=269354
@ -222,7 +222,7 @@ f_have()
|
||||
|
||||
# setvar $var_to_set [$value]
|
||||
#
|
||||
# Implement setvar for shells such as unlike FreeBSD sh(1).
|
||||
# Implement setvar for shells unlike FreeBSD sh(1).
|
||||
#
|
||||
if ! f_have setvar; then
|
||||
setvar()
|
||||
@ -236,6 +236,10 @@ setvar()
|
||||
*) f_err "setvar: too many arguments\n"
|
||||
return $FAILURE
|
||||
esac
|
||||
case "$__setvar_var_to_set" in *[!0-9A-Za-z_]*)
|
||||
f_err "setvar: %s: bad variable name\n" "$__setvar_var_to_set"
|
||||
return 2
|
||||
esac
|
||||
while case "$__setvar_r" in *\'*) : ;; *) false ; esac
|
||||
do
|
||||
__setvar_left="$__setvar_left${__setvar_right%%\'*}'\\''"
|
||||
|
Loading…
Reference in New Issue
Block a user