From: Paul Hänsch Date: Sun, 15 Jul 2018 19:06:28 +0000 (+0200) Subject: escape spaces in stored data for easyer use with `read` X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=a420ed0a86e9d315a868ea0b3eb0e965f110629f;p=cgilite escape spaces in stored data for easyer use with `read` --- diff --git a/storage.sh b/storage.sh index f5a0ac6..8bd1b95 100755 --- a/storage.sh +++ b/storage.sh @@ -68,6 +68,8 @@ STRING(){ s;\n;\\n;g; s;\t;\\t;g; s;\r;\\r;g; + s;\+;\\+;g; + s; ;+;g; ' } @@ -77,7 +79,9 @@ UNSTRING(){ s;((^|[^\\])(\\\\)*)\\n;\1\n;g; s;((^|[^\\])(\\\\)*)\\t;\1\t;g; s;((^|[^\\])(\\\\)*)\\r;\1\r;g; + s;((^|[^\\])(\\\\)*)\+;\1 ;g; tX; + s;((^|[^\\])(\\\\)*)\\\+;\1+;g; s;\\\\;\\;g; ' }