From 9b9fdbda81790c06973d77c4b3c5b75be9dbebde Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 18 Mar 2022 09:17:22 -0700 Subject: 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"). --- testcases | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'testcases') 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 }' +: +'" -- cgit v1.2.3