base-files: functions.sh: prepend() always adds separator

It shouldn't gate on the value, since the value will ostensibly
always be set; instead it should depend on the variable being
prepended to being non-empty.

Fixes #14403

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
This commit is contained in:
Philip Prindeville 2024-01-01 15:37:34 -07:00
parent 5798e12e4a
commit 95157dde04
1 changed files with 1 additions and 1 deletions

View File

@ -45,7 +45,7 @@ prepend() {
local value="$2"
local sep="${3:- }"
eval "export ${NO_EXPORT:+-n} -- \"$var=\${$value:+\${$value}\$sep}\$var\""
eval "export ${NO_EXPORT:+-n} -- \"$var=\$value\${$var:+\${sep}\${$var}}\""
}
list_contains() {