aboutsummaryrefslogtreecommitdiffstats
path: root/testcases
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-03-18 09:17:22 -0700
committerKaz Kylheku <kaz@kylheku.com>2022-03-18 09:17:22 -0700
commit9b9fdbda81790c06973d77c4b3c5b75be9dbebde (patch)
treedec76fce5d3c885eabc83ebedac9b64d9ac4e74e /testcases
parentfc1f328339f7366fab9d197a2876d8207f38656c (diff)
downloadcppawk-9b9fdbda81790c06973d77c4b3c5b75be9dbebde.tar.gz
cppawk-9b9fdbda81790c06973d77c4b3c5b75be9dbebde.tar.bz2
cppawk-9b9fdbda81790c06973d77c4b3c5b75be9dbebde.zip
Handle quoting properly.
The problem is that if $var holds escaped syntax, we cannot just use it as command $var; the quotes become part of the argument. We must get the shell to process the quoted syntax, which requires eval. For this we define a function which lets us do command $(syntax "$var").
Diffstat (limited to 'testcases')
-rw-r--r--testcases5
1 files changed, 5 insertions, 0 deletions
diff --git a/testcases b/testcases
index 04e90dd..71b9169 100644
--- a/testcases
+++ b/testcases
@@ -116,3 +116,8 @@ gawk
./cppawk --prepro-only 'BEGIN { }' | grep BEGIN
:
BEGIN { }
+--
+22:
+./cppawk -v foo="'\"" 'BEGIN { print foo }'
+:
+'"