From: Philip Prindeville Date: Mon, 1 Jan 2024 22:37:34 +0000 (-0700) Subject: base-files: functions.sh: prepend() always adds separator X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=95157dde046058f745437a37a35d8136c8c84608;p=openwrt%2Fstaging%2Fblocktrron.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 851d2f1791..d23a56e0cf 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() {