aboutsummaryrefslogtreecommitdiffstats
path: root/doc/gawk.texi
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2015-03-18 21:54:45 +0200
committerArnold D. Robbins <arnold@skeeve.com>2015-03-18 21:54:45 +0200
commit480aca31c7772dafeb1b97cd7a768bca2f49d3c7 (patch)
tree0c8b33ff856793d1cc21f976a822a1d8b29991fe /doc/gawk.texi
parentcd2ff61aaf4938092517880ad7655828d99a3cb9 (diff)
parent925f9363c4b0a5bb9375298afcdcf404efb32587 (diff)
downloadegawk-480aca31c7772dafeb1b97cd7a768bca2f49d3c7.tar.gz
egawk-480aca31c7772dafeb1b97cd7a768bca2f49d3c7.tar.bz2
egawk-480aca31c7772dafeb1b97cd7a768bca2f49d3c7.zip
Merge branch 'gawk-4.1-stable'
Diffstat (limited to 'doc/gawk.texi')
-rw-r--r--doc/gawk.texi13
1 files changed, 11 insertions, 2 deletions
diff --git a/doc/gawk.texi b/doc/gawk.texi
index 27cbcab2..8005fe3f 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -34830,11 +34830,16 @@ properly:
# Please set INPLACE_SUFFIX to make a backup copy. For example, you may
# want to set INPLACE_SUFFIX to .bak on the command line or in a BEGIN rule.
+# N.B. We call inplace_end() in the BEGINFILE and END rules so that any
+# actions in an ENDFILE rule will be redirected as expected.
+
BEGINFILE @{
- inplace_begin(FILENAME, INPLACE_SUFFIX)
+ if (_inplace_filename != "")
+ inplace_end(_inplace_filename, INPLACE_SUFFIX)
+ inplace_begin(_inplace_filename = FILENAME, INPLACE_SUFFIX)
@}
-ENDFILE @{
+END @{
inplace_end(FILENAME, INPLACE_SUFFIX)
@}
@end group
@@ -34849,6 +34854,10 @@ If @code{INPLACE_SUFFIX} is not an empty string, the original file is
linked to a backup @value{FN} created by appending that suffix. Finally,
the temporary file is renamed to the original @value{FN}.
+The @code{_inplace_filename} variable serves to keep track of the
+current filename so as to not invoke @code{inplace_end()} before
+processing the first file.
+
If any error occurs, the extension issues a fatal error to terminate
processing immediately without damaging the original file.