]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Simplify merge-cf.data.pre.awk, not relying on command line variable assignments...
authorhno <>
Wed, 26 Sep 2007 04:26:02 +0000 (04:26 +0000)
committerhno <>
Wed, 26 Sep 2007 04:26:02 +0000 (04:26 +0000)
scripts/merge-cf.data.pre.awk

index e09cd092933a14aa9329ac3836adad538da19db9..da52e4623db4264e014ec73b8143d2da52d7f8c2 100755 (executable)
@@ -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;