From: hno <> Date: Wed, 26 Sep 2007 04:26:02 +0000 (+0000) Subject: Simplify merge-cf.data.pre.awk, not relying on command line variable assignments... X-Git-Tag: SQUID_3_0_RC1~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a88b755a3d6315c5bf6d9eea8f4ad1463a45383f;p=thirdparty%2Fsquid.git Simplify merge-cf.data.pre.awk, not relying on command line variable assignments to find the conf files --- diff --git a/scripts/merge-cf.data.pre.awk b/scripts/merge-cf.data.pre.awk index e09cd09293..da52e4623d 100755 --- a/scripts/merge-cf.data.pre.awk +++ b/scripts/merge-cf.data.pre.awk @@ -2,12 +2,14 @@ # This script reassembles a split configuration file back into a cf.data.pre # file. -BEGIN { dir = SRCDIR "conf/"; } /^NAME: / { tag = $2; + dir = FILENAME; + gsub(/[^/\\]*$/, "", dir); file=dir tag ".txt"; $0 = "FILE_NOT_FOUND"; - getline < file; + if (!getline < file) + $0 = "FILE_NOT_FOUND"; if (/^FILE_NOT_FOUND/) { print "ERROR: '" file "' not found!" > "/dev/stderr"; exit 1;