aboutsummaryrefslogtreecommitdiffstats
path: root/awklib/extract.awk
diff options
context:
space:
mode:
Diffstat (limited to 'awklib/extract.awk')
-rw-r--r--awklib/extract.awk7
1 files changed, 4 insertions, 3 deletions
diff --git a/awklib/extract.awk b/awklib/extract.awk
index 96fc9498..0c20e299 100644
--- a/awklib/extract.awk
+++ b/awklib/extract.awk
@@ -30,7 +30,7 @@ BEGIN { IGNORECASE = 1 }
}
if ($3 != curfile) {
if (curfile != "")
- filelist[curfile]++ # save to close later
+ filelist[curfile] = 1 # save to close later
curfile = $3
}
@@ -61,8 +61,9 @@ BEGIN { IGNORECASE = 1 }
}
}
END {
- for (f in filelist)
- close(filelist[f])
+ close(curfile) # close the last one
+ for (f in filelist) # close all the rest
+ close(f)
}
function unexpected_eof()
{