aboutsummaryrefslogtreecommitdiffstats
path: root/doc/gawk.texi
diff options
context:
space:
mode:
Diffstat (limited to 'doc/gawk.texi')
-rw-r--r--doc/gawk.texi7
1 files changed, 4 insertions, 3 deletions
diff --git a/doc/gawk.texi b/doc/gawk.texi
index 9a3c75fd..0d4c49a3 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -26728,7 +26728,7 @@ line. That line is then printed to the output file:
@}
if ($3 != curfile) @{
if (curfile != "")
- filelist[curfile]++ # save to close later
+ filelist[curfile] = 1 # save to close later
curfile = $3
@}
@@ -26785,8 +26785,9 @@ is finished:
@c file eg/prog/extract.awk
@group
END @{
- for (f in filelist)
- close(filelist[f])
+ close(curfile) # close the last one
+ for (f in filelist) # close all the rest
+ close(f)
@}
@end group
@c endfile