From f0383eeb634ce1ae71bfb409a9bc25d84b6d79e9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Wed, 29 Jan 2020 19:03:50 +0100 Subject: [PATCH] bugfix, STRING and UNSTRING input like "foo[bar]" --- storage.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/storage.sh b/storage.sh index d84f0c2..7f70e64 100755 --- a/storage.sh +++ b/storage.sh @@ -91,7 +91,7 @@ STRING(){ " "*) out="${out}\\t"; in="${in# }" ;; +*) out="${out}\\+"; in="${in#+}" ;; " "*) out="${out}+"; in="${in# }" ;; - *) out="${out}${in%%[\\${CR}${BR} + ]*}"; in="${in#${in%%[\\${BR}${CR} + ]*}}" ;; + *) out="${out}${in%%[\\${CR}${BR} + ]*}"; in="${in#"${in%%[\\${BR}${CR} + ]*}"}" ;; esac; done printf '%s' "$out" } @@ -122,7 +122,7 @@ UNSTRING(){ \\+) out="${out}+"; in="${in#\\+}" ;; +*) out="${out} "; in="${in#+}" ;; \\*) in="${in#\\}" ;; - *) out="${out}${in%%[\\+]*}"; in="${in#${in%%[\\+]*}}" ;; + *) out="${out}${in%%[\\+]*}"; in="${in#"${in%%[\\+]*}"}" ;; esac; done printf '%s' "$out" } -- 2.39.2