Skip to content

Commit

Permalink
fixed backtick in quoted string (#2)
Browse files Browse the repository at this point in the history
Previously, the vale evaluatet the string itself.
Now it evaluates just the varible name, the value is copied as it was between the quotas.
  • Loading branch information
sopos committed Feb 8, 2021
1 parent 9217d1b commit 9d48dc5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ya.sh
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,8 @@ __INTERNAL_yash_sanitize_value() {

__INTERNAL_yash_unquote() {
local var_name="$1"
if [[ "${!var_name}" =~ ^[[:space:]]*\".*\"[[:space:]]*$ ]] || [[ "${!var_name}" =~ ^[[:space:]]*\'.*\'[[:space:]]*$ ]]; then #"
eval "$var_name=${!var_name}" || {
if [[ "${!var_name}" =~ ^[[:space:]]*\"(.*)\"[[:space:]]*$ ]] || [[ "${!var_name}" =~ ^[[:space:]]*\'(.*)\'[[:space:]]*$ ]]; then #"
eval "$var_name=\${BASH_REMATCH[1]}" || {
yashLogError "could not unquote ${!var_name}"
return 1
}
Expand Down

0 comments on commit 9d48dc5

Please sign in to comment.