diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2022-03-18 13:14:15 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2022-03-18 13:14:15 -0700 |
commit | ead2fc9a61b2986957b7aa0cbc487c149b4424a5 (patch) | |
tree | d0957f1cd3a22f9fc3132af6ba709a738017010c | |
parent | fa993f68f6ca85299d816e01914629044857e56e (diff) | |
download | cppawk-ead2fc9a61b2986957b7aa0cbc487c149b4424a5.tar.gz cppawk-ead2fc9a61b2986957b7aa0cbc487c149b4424a5.tar.bz2 cppawk-ead2fc9a61b2986957b7aa0cbc487c149b4424a5.zip |
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").
-rwxr-xr-x | cppawk | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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" |