gawk-diffs
[Top][All Lists]
Advanced

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

[SCM] gawk branch, feature/bwk-csv, updated. gawk-4.1.0-4902-gb090f4f3


From: Arnold Robbins
Subject: [SCM] gawk branch, feature/bwk-csv, updated. gawk-4.1.0-4902-gb090f4f3
Date: Wed, 31 Aug 2022 13:27:29 -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, feature/bwk-csv has been updated
       via  b090f4f3880a3f94d4dc986e7ab8dd3b9043b60e (commit)
      from  4c3fff7c4dccbc0c6839f2db85d9a45b11995484 (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=b090f4f3880a3f94d4dc986e7ab8dd3b9043b60e

commit b090f4f3880a3f94d4dc986e7ab8dd3b9043b60e
Author: Arnold D. Robbins <arnold@skeeve.com>
Date:   Wed Aug 31 20:27:10 2022 +0300

    Make split() do CSV parsing too.

diff --git a/ChangeLog b/ChangeLog
index 6cd26809..261417df 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2022-08-31         Arnold D. Robbins     <arnold@skeeve.com>
+
+       * field.c (do_split): Make "," as third arg do CSV parsing.
+
 2022-08-30         Arnold D. Robbins     <arnold@skeeve.com>
 
        * field.c (comma_parse_field): Add resizing of new field buffer;
diff --git a/field.c b/field.c
index be9f1fb0..c64fbace 100644
--- a/field.c
+++ b/field.c
@@ -1184,6 +1184,15 @@ do_split(int nargs)
                } else if (fs->stlen == 1 && (sep->re_flags & CONSTANT) == 0) {
                        if (fs->stptr[0] == ' ') {
                                parseit = def_parse_field;
+                       } else if (fs->stptr[0] == ',') {
+                               static bool warned = false;
+
+                               parseit = comma_parse_field;
+
+                               if (do_lint && ! warned) {
+                                       warned = true;
+                                       lintwarn(_("split: CSV parsing is a 
non-standard extension"));
+                               }
                        } else
                                parseit = sc_parse_field;
                } else {

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

Summary of changes:
 ChangeLog | 4 ++++
 field.c   | 9 +++++++++
 2 files changed, 13 insertions(+)


hooks/post-receive
-- 
gawk



reply via email to

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