From 29f1563294ac1ab19aa252f3fd5fca94c4f88516 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 27 May 2018 18:43:20 +0300 Subject: Bug fix to extract.awk. Rerun and update files. --- awklib/extract.awk | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'awklib/extract.awk') diff --git a/awklib/extract.awk b/awklib/extract.awk index 2662574b..96fc9498 100644 --- a/awklib/extract.awk +++ b/awklib/extract.awk @@ -30,7 +30,7 @@ BEGIN { IGNORECASE = 1 } } if ($3 != curfile) { if (curfile != "") - close(curfile) + filelist[curfile]++ # save to close later curfile = $3 } @@ -60,6 +60,10 @@ BEGIN { IGNORECASE = 1 } print join(a, 1, n, SUBSEP) > curfile } } +END { + for (f in filelist) + close(filelist[f]) +} function unexpected_eof() { printf("extract: %s:%d: unexpected EOF or error\n", @@ -67,10 +71,6 @@ function unexpected_eof() exit 1 } -END { - if (curfile) - close(curfile) -} # join.awk --- join an array into a string # # Arnold Robbins, arnold@gnu.org, Public Domain -- cgit v1.2.3