Jelajahi Sumber

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 <[email protected]>
Philip Prindeville 1 tahun lalu
induk
melakukan
95157dde04
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      package/base-files/files/lib/functions.sh

+ 1 - 1
package/base-files/files/lib/functions.sh

@@ -45,7 +45,7 @@ prepend() {
 	local value="$2"
 	local value="$2"
 	local sep="${3:- }"
 	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() {
 list_contains() {