From 508cf8813466b5e3a9993848b400ea3808bf0127 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 22 Mar 2022 22:29:56 -0700 Subject: bugfix: missing space breaks --prepro-only. Fix issue with interpolation of $prepro_opts in the case when the awk program is in the command line. --- cppawk | 2 +- testcases | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/cppawk b/cppawk index 565a445..272f83d 100755 --- a/cppawk +++ b/cppawk @@ -154,7 +154,7 @@ elif [ $# -gt 0 ] ; then tmp_file=$(mktemp) if [ $prepro_only ] ; then printf "%s" "$1" | $delhashbang | \ - eval '$prepro $incopt"$(pwd)"'"$prepro_opts - | collapse" + eval '$prepro $incopt"$(pwd)" '"$prepro_opts - | collapse" else printf "%s" "$1" | $delhashbang | \ eval '$prepro $incopt"$(pwd)" '"$prepro_opts - | collapse" > $tmp_file diff --git a/testcases b/testcases index 8b7dc81..2cd3ed4 100644 --- a/testcases +++ b/testcases @@ -170,3 +170,11 @@ BEGIN { }' : -2147483648 -2147483648 -2147483648 +-- +31: +./cppawk --prepro-only ' +#if __gawk__ +foo_bar +#endif' | grep foo_bar +: +foo_bar -- cgit v1.2.3