From: Paul Hänsch Date: Wed, 29 Jan 2020 18:03:50 +0000 (+0100) Subject: bugfix, STRING and UNSTRING input like "foo[bar]" X-Git-Url: http://git.plutz.net/?p=cgilite;a=commitdiff_plain;h=f0383eeb634ce1ae71bfb409a9bc25d84b6d79e9;ds=sidebyside bugfix, STRING and UNSTRING input like "foo[bar]" --- 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" }