]> git.plutz.net Git - cgilite/blobdiff - storage.sh
bugfix, STRING and UNSTRING input like "foo[bar]"
[cgilite] / 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"
 }