summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau2023-09-15 22:00:00 +0000
committerPetr Štetiar2025-11-13 10:45:59 +0000
commit82cb5fd66af910c71deef67d49a5c9e3d319bde9 (patch)
tree27514a7480d9d1dd2014692160bde4b86d871d87
parent17143f94dcbfef20d55afab783deb0e24cf67f15 (diff)
downloadlibubox-82cb5fd66af910c71deef67d49a5c9e3d319bde9.tar.gz
libubox: Drop extraneous space when appending values to variable
Don't have a leading space when building out a variable via appends. Fixes: #15 Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com> Signed-off-by: Petr Štetiar <ynezz@true.cz> [fix fixes trailer]
-rw-r--r--sh/jshn.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/sh/jshn.sh b/sh/jshn.sh
index 1d30557..66ca952 100644
--- a/sh/jshn.sh
+++ b/sh/jshn.sh
@@ -23,7 +23,7 @@ __jshn_raw_append() {
_jshn_append() {
# var=$1
local _a_value="$2"
- eval "${JSON_PREFIX}$1=\"\${${JSON_PREFIX}$1} \$_a_value\""
+ eval "${JSON_PREFIX}$1=\"\${${JSON_PREFIX}$1}\${${JSON_PREFIX}$1:+ }\$_a_value\""
}
_get_var() {