gawk-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gawk-diffs] [SCM] gawk branch, master, updated. gawk-4.1.0-2566-g6163a2


From: Andrew J. Schorr
Subject: [gawk-diffs] [SCM] gawk branch, master, updated. gawk-4.1.0-2566-g6163a2b
Date: Wed, 24 May 2017 09:50:14 -0400 (EDT)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".

The branch, master has been updated
       via  6163a2b1d5bdc76c395f5c7c1d0d8ef445011357 (commit)
      from  21f45911879abbaf5933c65df1beac8399b30038 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=6163a2b1d5bdc76c395f5c7c1d0d8ef445011357

commit 6163a2b1d5bdc76c395f5c7c1d0d8ef445011357
Author: Andrew J. Schorr <address@hidden>
Date:   Wed May 24 09:49:29 2017 -0400

    FIELDWIDTHS parsing should protect against blanks after skip separator, and 
fix field number in error message.

diff --git a/ChangeLog b/ChangeLog
index 2072972..cbe2abb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2017-05-24         Andrew J. Schorr     <address@hidden>
+
+       * field.c (set_FIELDWIDTHS): Add check to protect against blank
+       characters after a `:' skip separator. 
+       Fix field number in error message, thanks to a bug report
+       from Michal Jaegermann.
+
 2017-05-23         Andrew J. Schorr     <address@hidden>
 
        * field.c (set_FIELDWIDTHS): Simplify the logic and consistentify
diff --git a/field.c b/field.c
index 54055ad..61f0d7f 100644
--- a/field.c
+++ b/field.c
@@ -1182,7 +1182,7 @@ set_FIELDWIDTHS()
                if (errno == 0 && *end == ':' && (0 < tmp && tmp <= UINT_MAX)) {
                        FIELDWIDTHS->fields[i].skip = tmp;
                        scan = end + 1;
-                       if (*scan == '-') {
+                       if (*scan == '-' || is_blank(*scan)) {
                                fatal_error = true;
                                break;
                        }
@@ -1223,7 +1223,7 @@ set_FIELDWIDTHS()
 
        if (fatal_error)
                fatal(_("invalid FIELDWIDTHS value, for field %d, near `%s'"),
-                             i, scan);
+                             i + 1, scan);
 }
 
 /* set_FS --- handle things when FS is assigned to */
diff --git a/test/ChangeLog b/test/ChangeLog
index aef9822..0d8978f 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
+2017-05-24         Andrew J. Schorr     <address@hidden>
+
+       * fwtest8.ok: Fix field number in error message, thanks to a bug
+       report from Michal Jaegermann.
+
 2017-05-23         Arnold D. Robbins     <address@hidden>
 
        * Makefile.am (fwtest5, fwtest6, fwtest7, fwtest8): New tests.
diff --git a/test/fwtest8.ok b/test/fwtest8.ok
index 8a685a8..8ecd167 100644
--- a/test/fwtest8.ok
+++ b/test/fwtest8.ok
@@ -1,2 +1,2 @@
-gawk: fwtest8.awk:1: fatal: invalid FIELDWIDTHS value, for field 1, near `-1 4'
+gawk: fwtest8.awk:1: fatal: invalid FIELDWIDTHS value, for field 2, near `-1 4'
 EXIT CODE: 2

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog       | 7 +++++++
 field.c         | 4 ++--
 test/ChangeLog  | 5 +++++
 test/fwtest8.ok | 2 +-
 4 files changed, 15 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
gawk



reply via email to

[Prev in Thread] Current Thread [Next in Thread]