From ead2fc9a61b2986957b7aa0cbc487c149b4424a5 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 18 Mar 2022 13:14:15 -0700 Subject: Ensure we pass -- before non-option arguments. This is necessary even though our option processing has itself recognized the end of options. The reason is that we do not pass through -- to the list of awk options. (We cannot, because we add options after the awk options like this: $awk $awk_opts -f $tmp_file"). --- cppawk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cppawk b/cppawk index 1b2f1d6..9998b57 100755 --- a/cppawk +++ b/cppawk @@ -126,7 +126,7 @@ if [ -n "$awk_file" ] ; then eval '$prepro $incopt"$(dirname "$awk_file")" '"$prepro_opts -" > $tmp_file [ $prepro_only ] \ && cat $tmp_file \ - || eval "$awk $awk_opts -f $tmp_file" "$@" + || eval "$awk $awk_opts -f $tmp_file -- \"\$@\"" elif [ $# -gt 0 ] ; then tmp_file=$(mktemp) if [ $prepro_only ] ; then @@ -136,7 +136,7 @@ elif [ $# -gt 0 ] ; then printf "%s" "$1" | $delhashbang | \ eval '$prepro $incopt"$(pwd)" '"$prepro_opts -" > $tmp_file shift - eval "$awk $awk_opts -f $tmp_file \"\$@\"" + eval "$awk $awk_opts -f $tmp_file -- \"\$@\"" fi else die "awk code must be specified" -- cgit v1.2.3