Merge pull request #43224 from volth/patch-179

[staging] substitute(): --subst-var was silently coercing to "" if the variable does not exist.
This commit is contained in:
Matthew Bauer 2018-07-21 15:48:14 -04:00 committed by GitHub
commit 37273afd27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -660,6 +660,10 @@ substituteStream() {
echo "substituteStream(): ERROR: substitution variables must be valid Bash names, \"$varName\" isn't." >&2
return 1
fi
if [ -z ${!varName+x} ]; then
echo "substituteStream(): ERROR: variable \$$varName is unset" >&2
return 1
fi
pattern="@$varName@"
replacement="${!varName}"
;;