From c7f4ecf9c261ce09c4e8ddc0185505f551cf49a4 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 8 Mar 2023 14:23:50 -0600 Subject: Correctly quote to catch whitespace characters --- vellum | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vellum b/vellum index 8cd03c2..5058b34 100755 --- a/vellum +++ b/vellum @@ -1,4 +1,4 @@ -set +x +# make sure to put a shebang here readc() { # arg: # adapted from https://unix.stackexchange.com/a/464963 @@ -30,10 +30,10 @@ readc() { # arg: # Break on EOF test -n "$c" || break - eval "$var=\${$var}$c" + eval "$var=\"\${$var}$c\"" # Break when we have a full character (wc -m) - test "$(eval printf %s "\$$var" | wc -m)" -eq 0 || break + test "$(eval printf %s "\"\$$var\"" | wc -m)" -eq 0 || break done # Round-trip sanitized variables -- cgit 1.4.1-21-gabe81