From: Philip Prindeville Date: Mon, 1 Jan 2024 22:37:34 +0000 (-0700) Subject: base-files: functions.sh: prepend() always adds separator X-Git-Tag: v24.10.0-rc1~3331 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F14317%2Fhead;p=thirdparty%2Fopenwrt.git 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 --- diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh index 851d2f1791c..d23a56e0cf0 100644 --- a/package/base-files/files/lib/functions.sh +++ b/package/base-files/files/lib/functions.sh @@ -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() {