aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2018-09-18 11:40:34 +0300
committerArnold D. Robbins <arnold@skeeve.com>2018-09-18 11:40:34 +0300
commit362a100732b1017b54d3d6c6f14ea6ba59e657c2 (patch)
treec693b01f98fa65902b0f8bed27f1917c67dbf48e
parentc515c7d93ca941383e14de219dca592743ec0495 (diff)
parent82f0a742be462298c0da027bc4fb56ddcb667c02 (diff)
downloadegawk-362a100732b1017b54d3d6c6f14ea6ba59e657c2.tar.gz
egawk-362a100732b1017b54d3d6c6f14ea6ba59e657c2.tar.bz2
egawk-362a100732b1017b54d3d6c6f14ea6ba59e657c2.zip
Merge branch 'master' into feature/fix-comments
-rwxr-xr-xChangeLog20
-rw-r--r--NEWS5
-rw-r--r--builtin.c3
-rwxr-xr-xconfig.rpath2
-rw-r--r--field.c22
5 files changed, 42 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 399c01a6..b9bf04f6 100755
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+2018-09-18 Arnold D. Robbins <arnold@skeeve.com>
+
+ * NEWS: Fix typo in gettext version.
+
+ Unrelated:
+
+ * field.c (get_field): Move lint check for field access in an
+ END rule to top level, make wording more general.
+ * builtin.c (do_print_rec): Restore check before calling get_field()
+ and add do_lint to the condition.
+
+ Unrelated:
+
+ * field.c (set_NF): Add lint warning if decrementing NF, which
+ doesn't work on older Unix awks.
+
+ Unrelated:
+
+ * config.rpath: Sync to GNULIB.
+
2018-09-16 gettextize <bug-gnu-gettext@gnu.org>
* configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.19.8.
diff --git a/NEWS b/NEWS
index 9950abcc..d0a7f8d2 100644
--- a/NEWS
+++ b/NEWS
@@ -28,7 +28,10 @@ Changes from 4.2.1 to 4.2.2
me to stop carrying forward decades of changes against the original
ones from GLIBC.
-4. Infrastructure upgrades: Bison 3.1, Automake 1.16.1, Gettext 0.18.1.
+4. Infrastructure upgrades: Bison 3.1, Automake 1.16.1, Gettext 0.19.8.1.
+
+XX. A number of bugs, some of them quite significant, have been fixed.
+ See the ChangeLog for details.
Changes from 4.2.0 to 4.2.1
---------------------------
diff --git a/builtin.c b/builtin.c
index 8247ca33..d7b2337e 100644
--- a/builtin.c
+++ b/builtin.c
@@ -2364,7 +2364,8 @@ do_print_rec(int nargs, int redirtype)
if (fp == NULL)
return;
- (void) get_field(0L, NULL); /* rebuild record if necessary */
+ if (! field0_valid || do_lint) // lint check for field access in END
+ (void) get_field(0L, NULL);
f0 = fields_arr[0];
diff --git a/config.rpath b/config.rpath
index 98183ff2..fc5913d7 100755
--- a/config.rpath
+++ b/config.rpath
@@ -2,7 +2,7 @@
# Output a system dependent set of variables, describing how to set the
# run time search path of shared libraries in an executable.
#
-# Copyright 1996-2016 Free Software Foundation, Inc.
+# Copyright 1996-2018 Free Software Foundation, Inc.
# Taken from GNU libtool, 2001
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
diff --git a/field.c b/field.c
index 1c209c26..2f6eff70 100644
--- a/field.c
+++ b/field.c
@@ -396,6 +396,13 @@ set_NF()
nf = get_number_si(NF_node->var_value);
if (nf < 0)
fatal(_("NF set to negative value"));
+
+ static bool warned = false;
+ if (do_lint && NF > nf && ! warned) {
+ warned = true;
+ lintwarn(_("decrementing NF is not portable to many awk versions"));
+ }
+
NF = nf;
if (NF > nf_high_water)
@@ -832,18 +839,19 @@ NODE **
get_field(long requested, Func_ptr *assign)
{
bool in_middle = false;
+ static bool warned = false;
+ extern int currule;
+
+ if (do_lint && currule == END && ! warned) {
+ warned = true;
+ lintwarn(_("accessing fields from an END rule may not be portable"));
+ }
+
/*
* if requesting whole line but some other field has been altered,
* then the whole line must be rebuilt
*/
if (requested == 0) {
- static bool warned = false;
- extern int currule;
-
- if (do_lint && currule == END && ! warned) {
- warned = true;
- lintwarn(_("accessing $0 from an END rule may not be portable"));
- }
if (! field0_valid) {
/* first, parse remainder of input record */
if (NF == -1) {