summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rwxr-xr-xvellum6
1 files changed, 3 insertions, 3 deletions
diff --git a/vellum b/vellum index 8cd03c2..5058b34 100755 --- a/vellum +++ b/vellum
@@ -1,4 +1,4 @@
1set +x 1# make sure to put a shebang here
2 2
3readc() { # arg: <variable-name> 3readc() { # arg: <variable-name>
4 # adapted from https://unix.stackexchange.com/a/464963 4 # adapted from https://unix.stackexchange.com/a/464963
@@ -30,10 +30,10 @@ readc() { # arg: <variable-name>
30 # Break on EOF 30 # Break on EOF
31 test -n "$c" || break 31 test -n "$c" || break
32 32
33 eval "$var=\${$var}$c" 33 eval "$var=\"\${$var}$c\""
34 34
35 # Break when we have a full character (wc -m) 35 # Break when we have a full character (wc -m)
36 test "$(eval printf %s "\$$var" | wc -m)" -eq 0 || break 36 test "$(eval printf %s "\"\$$var\"" | wc -m)" -eq 0 || break
37 done 37 done
38 38
39 # Round-trip sanitized variables 39 # Round-trip sanitized variables