]> git.plutz.net Git - cgilite/commitdiff
bugfix, STRING and UNSTRING input like "foo[bar]"
authorPaul Hänsch <paul@plutz.net>
Wed, 29 Jan 2020 18:03:50 +0000 (19:03 +0100)
committerPaul Hänsch <paul@plutz.net>
Wed, 29 Jan 2020 18:03:50 +0000 (19:03 +0100)
storage.sh

index d84f0c26d6529ddbbf5555de53902e96b23eedc5..7f70e6480d6c89c8a32d3a9ee3fb68a5bfcc35b6 100755 (executable)
@@ -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"
 }