aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-03-23 07:59:49 -0700
committerKaz Kylheku <kaz@kylheku.com>2022-03-23 07:59:49 -0700
commite9ac5735afb5bb00512706a82fc9be8f1cd072e7 (patch)
treed223e7f49346fd6730ba881c2326dfa9e07eae6e
parent4136aa54ad5af058940baaf756686877894dcc40 (diff)
downloadcppawk-e9ac5735afb5bb00512706a82fc9be8f1cd072e7.tar.gz
cppawk-e9ac5735afb5bb00512706a82fc9be8f1cd072e7.tar.bz2
cppawk-e9ac5735afb5bb00512706a82fc9be8f1cd072e7.zip
clearer code around handling of awk file's directory.
-rwxr-xr-xcppawk3
1 files changed, 2 insertions, 1 deletions
diff --git a/cppawk b/cppawk
index 867308a..c45f6ef 100755
--- a/cppawk
+++ b/cppawk
@@ -158,8 +158,9 @@ trap 'rm -f $tmp_file' EXIT INT TERM
if [ -n "$awk_file" ] ; then
tmp_file=$(mktemp)
+ awk_file_dir=$(dirname "$awk_file")
$delhashbang "$awk_file" | \
- eval "$prepro $incopt"'"$(dirname "$awk_file")" '"$prepro_opts -" | \
+ eval "$prepro $incopt\"$awk_file_dir\" $prepro_opts -" | \
collapse > $tmp_file
[ $prepro_only ] \
&& cat $tmp_file \