diff options
| author | Philip Prindeville | 2024-01-01 22:37:34 +0000 |
|---|---|---|
| committer | Philip Prindeville | 2024-01-15 17:41:09 +0000 |
| commit | 95157dde046058f745437a37a35d8136c8c84608 (patch) | |
| tree | cbeb235f65271903db75b2f8c2cd8a0ca3ab258d | |
| parent | 5798e12e4a23abf71c8cf74e6f3565fe64c8da07 (diff) | |
| download | openwrt-95157dde046058f745437a37a35d8136c8c84608.tar.gz | |
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>
| -rw-r--r-- | package/base-files/files/lib/functions.sh | 2 |
1 files changed, 1 insertions, 1 deletions
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() { |