gawk-diffs
[Top][All Lists]
Advanced

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

[SCM] gawk branch, gawk-5.2-stable, updated. gawk-4.1.0-4999-ga908e81a


From: Arnold Robbins
Subject: [SCM] gawk branch, gawk-5.2-stable, updated. gawk-4.1.0-4999-ga908e81a
Date: Fri, 24 Feb 2023 03:32:28 -0500 (EST)

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, gawk-5.2-stable has been updated
       via  a908e81a6b4a41116e3268a915449881c9982209 (commit)
       via  da883f8177a12293a395d77c31d7aeaa95c254aa (commit)
       via  90da4e0a6fea0499b891bb3801fde88b99346367 (commit)
       via  1c16328521f317b4f3df3d3010fc17e9811bd5e1 (commit)
       via  2480186827f4e5f9b4269426742d5f4985dcbe01 (commit)
      from  e63cca98399dba068ef2c8fa9dff6be26e938b0c (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=a908e81a6b4a41116e3268a915449881c9982209

commit a908e81a6b4a41116e3268a915449881c9982209
Author: Arnold D. Robbins <arnold@skeeve.com>
Date:   Fri Feb 24 10:30:56 2023 +0200

    Small doc fix.

diff --git a/doc/ChangeLog b/doc/ChangeLog
index 4e4c1b14..076f60f6 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,7 @@
+2023-02-24         Arnold D. Robbins     <arnold@skeeve.com>
+
+       * gawktexi.in (Feature History): Add note about nonfatal I/O.
+
 2023-02-05         Arnold D. Robbins     <arnold@skeeve.com>
 
        * texinfo.tex: Update from GNULIB. Only change is to remove
diff --git a/doc/gawk.info b/doc/gawk.info
index 3bd67bea..2355ded3 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -30552,6 +30552,8 @@ POSIX ‘awk’, in the order they were added to 
‘gawk’.
    • Redirected ‘getline’ became allowed inside ‘BEGINFILE’ and
      ‘ENDFILE’ (*note BEGINFILE/ENDFILE::).
 
+   • Support for nonfatal I/O (*note Nonfatal::).
+
    • The ‘where’ command was added to the debugger (*note Execution
      Stack::).
 
@@ -37865,7 +37867,7 @@ Index
 * Kasal, Stepan:                         Acknowledgments.     (line  60)
 * Kelly, Terence:                        Persistent Memory.   (line  76)
 * Kelly, Terence <1>:                    Persistent Memory.   (line 127)
-* Kelly, Terence <2>:                    Feature History.     (line 508)
+* Kelly, Terence <2>:                    Feature History.     (line 510)
 * Kenobi, Obi-Wan:                       Undocumented.        (line   6)
 * Kernighan, Brian:                      History.             (line  17)
 * Kernighan, Brian, quotes:              Conventions.         (line  38)
@@ -39827,79 +39829,79 @@ Node: POSIX1255480
 Node: BTL1256905
 Node: POSIX/GNU1257674
 Node: Feature History1264205
-Node: Common Extensions1283270
-Node: Ranges and Locales1284639
-Ref: Ranges and Locales-Footnote-11289440
-Ref: Ranges and Locales-Footnote-21289467
-Ref: Ranges and Locales-Footnote-31289706
-Node: Contributors1289929
-Node: History summary1296134
-Node: Installation1297580
-Node: Gawk Distribution1298544
-Node: Getting1299036
-Node: Extracting1300035
-Node: Distribution contents1301747
-Node: Unix Installation1309827
-Node: Quick Installation1310649
-Node: Compiling with MPFR1313195
-Node: Shell Startup Files1313901
-Node: Additional Configuration Options1315058
-Node: Configuration Philosophy1317445
-Node: Compiling from Git1319947
-Node: Building the Documentation1320506
-Node: Non-Unix Installation1321918
-Node: PC Installation1322394
-Node: PC Binary Installation1323267
-Node: PC Compiling1324172
-Node: PC Using1325350
-Node: Cygwin1329078
-Node: MSYS1330334
-Node: OpenVMS Installation1330966
-Node: OpenVMS Compilation1331647
-Ref: OpenVMS Compilation-Footnote-11333130
-Node: OpenVMS Dynamic Extensions1333192
-Node: OpenVMS Installation Details1334828
-Node: OpenVMS Running1337263
-Node: OpenVMS GNV1341400
-Node: Bugs1342155
-Node: Bug definition1343079
-Node: Bug address1346730
-Node: Usenet1350321
-Node: Performance bugs1351552
-Node: Asking for help1354570
-Node: Maintainers1356561
-Node: Other Versions1357588
-Node: Installation summary1366520
-Node: Notes1367904
-Node: Compatibility Mode1368714
-Node: Additions1369536
-Node: Accessing The Source1370481
-Node: Adding Code1372016
-Node: New Ports1379152
-Node: Derived Files1383662
-Ref: Derived Files-Footnote-11389509
-Ref: Derived Files-Footnote-21389544
-Ref: Derived Files-Footnote-31390161
-Node: Future Extensions1390275
-Node: Implementation Limitations1390947
-Node: Extension Design1392189
-Node: Old Extension Problems1393353
-Ref: Old Extension Problems-Footnote-11394929
-Node: Extension New Mechanism Goals1394990
-Ref: Extension New Mechanism Goals-Footnote-11398486
-Node: Extension Other Design Decisions1398687
-Node: Extension Future Growth1400886
-Node: Notes summary1401510
-Node: Basic Concepts1402723
-Node: Basic High Level1403408
-Ref: figure-general-flow1403690
-Ref: figure-process-flow1404392
-Ref: Basic High Level-Footnote-11407788
-Node: Basic Data Typing1407977
-Node: Glossary1411395
-Node: Copying1444517
-Node: GNU Free Documentation License1482278
-Node: Index1507601
+Node: Common Extensions1283323
+Node: Ranges and Locales1284692
+Ref: Ranges and Locales-Footnote-11289493
+Ref: Ranges and Locales-Footnote-21289520
+Ref: Ranges and Locales-Footnote-31289759
+Node: Contributors1289982
+Node: History summary1296187
+Node: Installation1297633
+Node: Gawk Distribution1298597
+Node: Getting1299089
+Node: Extracting1300088
+Node: Distribution contents1301800
+Node: Unix Installation1309880
+Node: Quick Installation1310702
+Node: Compiling with MPFR1313248
+Node: Shell Startup Files1313954
+Node: Additional Configuration Options1315111
+Node: Configuration Philosophy1317498
+Node: Compiling from Git1320000
+Node: Building the Documentation1320559
+Node: Non-Unix Installation1321971
+Node: PC Installation1322447
+Node: PC Binary Installation1323320
+Node: PC Compiling1324225
+Node: PC Using1325403
+Node: Cygwin1329131
+Node: MSYS1330387
+Node: OpenVMS Installation1331019
+Node: OpenVMS Compilation1331700
+Ref: OpenVMS Compilation-Footnote-11333183
+Node: OpenVMS Dynamic Extensions1333245
+Node: OpenVMS Installation Details1334881
+Node: OpenVMS Running1337316
+Node: OpenVMS GNV1341453
+Node: Bugs1342208
+Node: Bug definition1343132
+Node: Bug address1346783
+Node: Usenet1350374
+Node: Performance bugs1351605
+Node: Asking for help1354623
+Node: Maintainers1356614
+Node: Other Versions1357641
+Node: Installation summary1366573
+Node: Notes1367957
+Node: Compatibility Mode1368767
+Node: Additions1369589
+Node: Accessing The Source1370534
+Node: Adding Code1372069
+Node: New Ports1379205
+Node: Derived Files1383715
+Ref: Derived Files-Footnote-11389562
+Ref: Derived Files-Footnote-21389597
+Ref: Derived Files-Footnote-31390214
+Node: Future Extensions1390328
+Node: Implementation Limitations1391000
+Node: Extension Design1392242
+Node: Old Extension Problems1393406
+Ref: Old Extension Problems-Footnote-11394982
+Node: Extension New Mechanism Goals1395043
+Ref: Extension New Mechanism Goals-Footnote-11398539
+Node: Extension Other Design Decisions1398740
+Node: Extension Future Growth1400939
+Node: Notes summary1401563
+Node: Basic Concepts1402776
+Node: Basic High Level1403461
+Ref: figure-general-flow1403743
+Ref: figure-process-flow1404445
+Ref: Basic High Level-Footnote-11407841
+Node: Basic Data Typing1408030
+Node: Glossary1411448
+Node: Copying1444570
+Node: GNU Free Documentation License1482331
+Node: Index1507654
 
 End Tag Table
 
diff --git a/doc/gawk.texi b/doc/gawk.texi
index 07afa6b4..c4337378 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -41871,6 +41871,10 @@ Redirected @code{getline} became allowed inside
 @code{BEGINFILE} and @code{ENDFILE}
 (@pxref{BEGINFILE/ENDFILE}).
 
+@item
+Support for nonfatal I/O
+(@pxref{Nonfatal}).
+
 @item
 The @code{where} command was added to the debugger
 (@pxref{Execution Stack}).
diff --git a/doc/gawktexi.in b/doc/gawktexi.in
index 158395b4..47657013 100644
--- a/doc/gawktexi.in
+++ b/doc/gawktexi.in
@@ -40787,6 +40787,10 @@ Redirected @code{getline} became allowed inside
 @code{BEGINFILE} and @code{ENDFILE}
 (@pxref{BEGINFILE/ENDFILE}).
 
+@item
+Support for nonfatal I/O
+(@pxref{Nonfatal}).
+
 @item
 The @code{where} command was added to the debugger
 (@pxref{Execution Stack}).

http://git.sv.gnu.org/cgit/gawk.git/commit/?id=da883f8177a12293a395d77c31d7aeaa95c254aa

commit da883f8177a12293a395d77c31d7aeaa95c254aa
Author: Arnold D. Robbins <arnold@skeeve.com>
Date:   Fri Feb 24 10:29:33 2023 +0200

    Bug fix in typeof, add new test files.

diff --git a/ChangeLog b/ChangeLog
index d9281cb3..488e7a49 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,9 @@
        * awk.h (boolval): Handle Node_var. Thanks to
        Daniel Pouzzner <douzzer@mega.nu> for the report, relayed
        by Andrew Schorr.
+       * builtin.c (do_typeof): Handle Node_var, could come from a
+       converted Node_elem_new. Thanks to Andrew Schorr for the
+       report.
 
 2023-02-23         Arnold D. Robbins     <arnold@skeeve.com>
 
diff --git a/builtin.c b/builtin.c
index 43ae6afc..4dd22e27 100644
--- a/builtin.c
+++ b/builtin.c
@@ -4324,6 +4324,21 @@ do_typeof(int nargs)
                        }
                }
                break;
+       case Node_var:
+               /*
+                * This can happen when a Node_elem_new gets turned into a 
Node_var.
+                * BEGIN {
+                *      f(a["b"])
+                *      print typeof(a["b"])
+                * }
+                *
+                * function f(x)
+                * {
+                *      return x
+                * }
+                */
+               arg = arg->var_value;
+               // fall through
        case Node_val:
                switch (fixtype(arg)->flags & 
(STRING|NUMBER|USER_INPUT|REGEX|BOOLVAL)) {
                case NUMBER|BOOLVAL:
@@ -4386,14 +4401,6 @@ do_typeof(int nargs)
                }
                deref = false;
                break;
-       case Node_var:
-               /*
-                * Note: this doesn't happen because the function calling code
-                * in interpret.h pushes Node_var->var_value.
-                */
-               fatal(_("typeof: invalid argument type `%s'"),
-                               nodetype2str(arg->type));
-               break;
        default:
                fatal(_("typeof: unknown argument type `%s'"),
                                nodetype2str(arg->type));
diff --git a/pc/ChangeLog b/pc/ChangeLog
index d45600d5..fea82a7d 100644
--- a/pc/ChangeLog
+++ b/pc/ChangeLog
@@ -1,3 +1,7 @@
+2023-02-24         Arnold D. Robbins     <arnold@skeeve.com>
+
+       * Makefile.tst: Regenerated.
+
 2023-01-31         Arnold D. Robbins     <arnold@skeeve.com>
 
        * Makefile.tst: Regenerated.
diff --git a/pc/Makefile.tst b/pc/Makefile.tst
index 1cb6f869..f9e9681b 100644
--- a/pc/Makefile.tst
+++ b/pc/Makefile.tst
@@ -193,7 +193,7 @@ GAWK_EXT_TESTS = \
        clos1way5 clos1way6 colonwarn commas crlf dbugeval dbugeval2 \
        dbugeval3 dbugeval4 dbugtypedre1 dbugtypedre2 delsub \
        devfd devfd1 devfd2 dfacheck1 dumpvars \
-       elemnew1 errno exit fieldwdth forcenum fpat1 fpat2 \
+       elemnew1 elemnew2 elemnew3 errno exit fieldwdth forcenum fpat1 fpat2 \
        fpat3 fpat4 fpat5 fpat6 fpat7 fpat8 fpat9 fpatnull fsfwfs functab1 \
        functab2 functab3 functab6 funlen fwtest fwtest2 fwtest3 fwtest4 \
        fwtest5 fwtest6 fwtest7 fwtest8 genpot gensub gensub2 gensub3 \
@@ -2760,6 +2760,16 @@ elemnew1:
        @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk  >_$@ 2>&1 || echo EXIT CODE: 
$$? >>_$@
        @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
 
+elemnew2:
+       @echo $@
+       @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk  >_$@ 2>&1 || echo EXIT CODE: 
$$? >>_$@
+       @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+elemnew3:
+       @echo $@
+       @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk  >_$@ 2>&1 || echo EXIT CODE: 
$$? >>_$@
+       @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
 exit:
        @echo $@
        @-$(LOCALES) AWK="$(AWKPROG)" "$(srcdir)"/$@.sh  > _$@ 2>&1 || echo 
EXIT CODE: $$? >>_$@
diff --git a/test/ChangeLog b/test/ChangeLog
index 8fbe6b2f..ebf83d45 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -2,6 +2,8 @@
 
        * Makefile.am (EXTRA_DIST): New test: elemnew2.
        * elemnew2.awk, elemnew2.ok: New files.
+       * Makefile.am (EXTRA_DIST): New test: elemnew3.
+       * elemnew3.awk, elemnew3.ok: New files.
 
 2023-02-09         Arnold D. Robbins     <arnold@skeeve.com>
 
diff --git a/test/Makefile.am b/test/Makefile.am
index 15708a1f..b30d3d7a 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -291,6 +291,8 @@ EXTRA_DIST = \
        elemnew1.ok \
        elemnew2.awk \
        elemnew2.ok \
+       elemnew3.awk \
+       elemnew3.ok \
        escapebrace.awk \
        escapebrace.in \
        escapebrace.ok \
@@ -1504,7 +1506,7 @@ GAWK_EXT_TESTS = \
        clos1way5 clos1way6 colonwarn commas crlf dbugeval dbugeval2 \
        dbugeval3 dbugeval4 dbugtypedre1 dbugtypedre2 delsub \
        devfd devfd1 devfd2 dfacheck1 dumpvars \
-       elemnew1 elemnew2 errno exit fieldwdth forcenum fpat1 fpat2 \
+       elemnew1 elemnew2 elemnew3 errno exit fieldwdth forcenum fpat1 fpat2 \
        fpat3 fpat4 fpat5 fpat6 fpat7 fpat8 fpat9 fpatnull fsfwfs functab1 \
        functab2 functab3 functab6 funlen fwtest fwtest2 fwtest3 fwtest4 \
        fwtest5 fwtest6 fwtest7 fwtest8 genpot gensub gensub2 gensub3 \
diff --git a/test/Makefile.in b/test/Makefile.in
index 9e9701fd..ed835ab6 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -559,6 +559,8 @@ EXTRA_DIST = \
        elemnew1.ok \
        elemnew2.awk \
        elemnew2.ok \
+       elemnew3.awk \
+       elemnew3.ok \
        escapebrace.awk \
        escapebrace.in \
        escapebrace.ok \
@@ -1772,7 +1774,7 @@ GAWK_EXT_TESTS = \
        clos1way5 clos1way6 colonwarn commas crlf dbugeval dbugeval2 \
        dbugeval3 dbugeval4 dbugtypedre1 dbugtypedre2 delsub \
        devfd devfd1 devfd2 dfacheck1 dumpvars \
-       elemnew1 elemnew2 errno exit fieldwdth forcenum fpat1 fpat2 \
+       elemnew1 elemnew2 elemnew3 errno exit fieldwdth forcenum fpat1 fpat2 \
        fpat3 fpat4 fpat5 fpat6 fpat7 fpat8 fpat9 fpatnull fsfwfs functab1 \
        functab2 functab3 functab6 funlen fwtest fwtest2 fwtest3 fwtest4 \
        fwtest5 fwtest6 fwtest7 fwtest8 genpot gensub gensub2 gensub3 \
@@ -4526,6 +4528,11 @@ elemnew2:
        @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk  >_$@ 2>&1 || echo EXIT CODE: 
$$? >>_$@
        @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
 
+elemnew3:
+       @echo $@
+       @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk  >_$@ 2>&1 || echo EXIT CODE: 
$$? >>_$@
+       @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
 exit:
        @echo $@
        @-$(LOCALES) AWK="$(AWKPROG)" "$(srcdir)"/$@.sh  > _$@ 2>&1 || echo 
EXIT CODE: $$? >>_$@
diff --git a/test/Maketests b/test/Maketests
index 331c501e..a4b215c6 100644
--- a/test/Maketests
+++ b/test/Maketests
@@ -1457,6 +1457,11 @@ elemnew2:
        @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk  >_$@ 2>&1 || echo EXIT CODE: 
$$? >>_$@
        @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
 
+elemnew3:
+       @echo $@
+       @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk  >_$@ 2>&1 || echo EXIT CODE: 
$$? >>_$@
+       @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
 exit:
        @echo $@
        @-$(LOCALES) AWK="$(AWKPROG)" "$(srcdir)"/$@.sh  > _$@ 2>&1 || echo 
EXIT CODE: $$? >>_$@
diff --git a/test/elemnew2.awk b/test/elemnew2.awk
new file mode 100644
index 00000000..4f765032
--- /dev/null
+++ b/test/elemnew2.awk
@@ -0,0 +1,15 @@
+#!/usr/bin/gawk -f
+   
+function f(x) {
+       return x;
+}
+       
+BEGIN {
+       print "a[b] is " (a["b"] ? "true" : "false");
+
+       f(a["b"]);
+
+       print "a[b] is " (a["b"] ? "true" : "false");
+       
+       print a["b"];
+}
diff --git a/test/elemnew2.ok b/test/elemnew2.ok
new file mode 100644
index 00000000..0de7b2d6
--- /dev/null
+++ b/test/elemnew2.ok
@@ -0,0 +1,3 @@
+a[b] is false
+a[b] is false
+
diff --git a/test/elemnew3.awk b/test/elemnew3.awk
new file mode 100644
index 00000000..4bb0d5d4
--- /dev/null
+++ b/test/elemnew3.awk
@@ -0,0 +1,9 @@
+BEGIN {
+       f(a["b"])
+       print typeof(a["b"])
+}
+
+function f(x)
+{
+       return x
+}
diff --git a/test/elemnew3.ok b/test/elemnew3.ok
new file mode 100644
index 00000000..3d17e76e
--- /dev/null
+++ b/test/elemnew3.ok
@@ -0,0 +1 @@
+unassigned

http://git.sv.gnu.org/cgit/gawk.git/commit/?id=90da4e0a6fea0499b891bb3801fde88b99346367

commit 90da4e0a6fea0499b891bb3801fde88b99346367
Author: Arnold D. Robbins <arnold@skeeve.com>
Date:   Fri Feb 24 10:23:45 2023 +0200

    Bug fix in boolval.

diff --git a/ChangeLog b/ChangeLog
index 02b2427a..d9281cb3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2023-02-24         Arnold D. Robbins     <arnold@skeeve.com>
+
+       * awk.h (boolval): Handle Node_var. Thanks to
+       Daniel Pouzzner <douzzer@mega.nu> for the report, relayed
+       by Andrew Schorr.
+
 2023-02-23         Arnold D. Robbins     <arnold@skeeve.com>
 
        * io.c (find_input_parser): Improve check to see if iop is
diff --git a/awk.h b/awk.h
index e9ed75ef..7208cea4 100644
--- a/awk.h
+++ b/awk.h
@@ -2031,6 +2031,9 @@ fixtype(NODE *n)
 static inline bool
 boolval(NODE *t)
 {
+       if (t->type == Node_var)        // could have come from converted 
Node_elem_new
+               t = t->var_value;
+
        (void) fixtype(t);
        if ((t->flags & NUMBER) != 0)
                return ! is_zero(t);
diff --git a/test/ChangeLog b/test/ChangeLog
index 7f7b05ee..8fbe6b2f 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
+2023-02-24         Arnold D. Robbins     <arnold@skeeve.com>
+
+       * Makefile.am (EXTRA_DIST): New test: elemnew2.
+       * elemnew2.awk, elemnew2.ok: New files.
+
 2023-02-09         Arnold D. Robbins     <arnold@skeeve.com>
 
        * badargs.ok: Update after code changes.
diff --git a/test/Makefile.am b/test/Makefile.am
index 24ae6787..15708a1f 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -289,6 +289,8 @@ EXTRA_DIST = \
        dynlj.ok \
        elemnew1.awk \
        elemnew1.ok \
+       elemnew2.awk \
+       elemnew2.ok \
        escapebrace.awk \
        escapebrace.in \
        escapebrace.ok \
@@ -1502,7 +1504,7 @@ GAWK_EXT_TESTS = \
        clos1way5 clos1way6 colonwarn commas crlf dbugeval dbugeval2 \
        dbugeval3 dbugeval4 dbugtypedre1 dbugtypedre2 delsub \
        devfd devfd1 devfd2 dfacheck1 dumpvars \
-       elemnew1 errno exit fieldwdth forcenum fpat1 fpat2 \
+       elemnew1 elemnew2 errno exit fieldwdth forcenum fpat1 fpat2 \
        fpat3 fpat4 fpat5 fpat6 fpat7 fpat8 fpat9 fpatnull fsfwfs functab1 \
        functab2 functab3 functab6 funlen fwtest fwtest2 fwtest3 fwtest4 \
        fwtest5 fwtest6 fwtest7 fwtest8 genpot gensub gensub2 gensub3 \
diff --git a/test/Makefile.in b/test/Makefile.in
index 8feff4ee..9e9701fd 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -557,6 +557,8 @@ EXTRA_DIST = \
        dynlj.ok \
        elemnew1.awk \
        elemnew1.ok \
+       elemnew2.awk \
+       elemnew2.ok \
        escapebrace.awk \
        escapebrace.in \
        escapebrace.ok \
@@ -1770,7 +1772,7 @@ GAWK_EXT_TESTS = \
        clos1way5 clos1way6 colonwarn commas crlf dbugeval dbugeval2 \
        dbugeval3 dbugeval4 dbugtypedre1 dbugtypedre2 delsub \
        devfd devfd1 devfd2 dfacheck1 dumpvars \
-       elemnew1 errno exit fieldwdth forcenum fpat1 fpat2 \
+       elemnew1 elemnew2 errno exit fieldwdth forcenum fpat1 fpat2 \
        fpat3 fpat4 fpat5 fpat6 fpat7 fpat8 fpat9 fpatnull fsfwfs functab1 \
        functab2 functab3 functab6 funlen fwtest fwtest2 fwtest3 fwtest4 \
        fwtest5 fwtest6 fwtest7 fwtest8 genpot gensub gensub2 gensub3 \
@@ -4519,6 +4521,11 @@ elemnew1:
        @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk  >_$@ 2>&1 || echo EXIT CODE: 
$$? >>_$@
        @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
 
+elemnew2:
+       @echo $@
+       @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk  >_$@ 2>&1 || echo EXIT CODE: 
$$? >>_$@
+       @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
 exit:
        @echo $@
        @-$(LOCALES) AWK="$(AWKPROG)" "$(srcdir)"/$@.sh  > _$@ 2>&1 || echo 
EXIT CODE: $$? >>_$@
diff --git a/test/Maketests b/test/Maketests
index 5d7dcee3..331c501e 100644
--- a/test/Maketests
+++ b/test/Maketests
@@ -1452,6 +1452,11 @@ elemnew1:
        @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk  >_$@ 2>&1 || echo EXIT CODE: 
$$? >>_$@
        @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
 
+elemnew2:
+       @echo $@
+       @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk  >_$@ 2>&1 || echo EXIT CODE: 
$$? >>_$@
+       @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
 exit:
        @echo $@
        @-$(LOCALES) AWK="$(AWKPROG)" "$(srcdir)"/$@.sh  > _$@ 2>&1 || echo 
EXIT CODE: $$? >>_$@

http://git.sv.gnu.org/cgit/gawk.git/commit/?id=1c16328521f317b4f3df3d3010fc17e9811bd5e1

commit 1c16328521f317b4f3df3d3010fc17e9811bd5e1
Author: Arnold D. Robbins <arnold@skeeve.com>
Date:   Thu Feb 23 19:54:44 2023 +0200

    Code improvement: RED_NOBUF -> RED_FLUSH.

diff --git a/ChangeLog b/ChangeLog
index 6e2b302b..02b2427a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,13 @@
        already being handled by an input parser. Found by
        code inspection.
 
+       Unrelated:
+
+       * awk.h (struct redirect): Change RED_NOBUF to RED_FLUSH.
+       * builtin.c (efwrite): Ditto
+       * io.c (redflags2str, check_duplicated_redirections,
+       redirect_string): Ditto.
+
 2023-02-09         Arnold D. Robbins     <arnold@skeeve.com>
 
        * main.c (usage): Include URL for source code in the message.
diff --git a/awk.h b/awk.h
index 79cdd85f..e9ed75ef 100644
--- a/awk.h
+++ b/awk.h
@@ -972,7 +972,7 @@ struct redirect {
                RED_READ        = 4,
                RED_WRITE       = 8,
                RED_APPEND      = 16,
-               RED_NOBUF       = 32,
+               RED_FLUSH       = 32,
                RED_USED        = 64,   /* closed temporarily to reuse fd */
                RED_EOF         = 128,
                RED_TWOWAY      = 256,
diff --git a/builtin.c b/builtin.c
index 95bcbadb..43ae6afc 100644
--- a/builtin.c
+++ b/builtin.c
@@ -192,7 +192,7 @@ efwrite(const void *ptr,
        }
        if (flush
          && ((fp == stdout && output_is_tty)
-             || (rp != NULL && (rp->flag & RED_NOBUF) != 0)))
+             || (rp != NULL && (rp->flag & RED_FLUSH) != 0)))
                efflush(fp, from, rp);
 }
 
diff --git a/io.c b/io.c
index 0911899f..979cad45 100644
--- a/io.c
+++ b/io.c
@@ -693,7 +693,7 @@ redflags2str(int flags)
                { RED_READ,     "RED_READ" },
                { RED_WRITE,    "RED_WRITE" },
                { RED_APPEND,   "RED_APPEND" },
-               { RED_NOBUF,    "RED_NOBUF" },
+               { RED_FLUSH,    "RED_FLUSH" },
                { RED_EOF,      "RED_EOF" },
                { RED_TWOWAY,   "RED_TWOWAY" },
                { RED_PTY,      "RED_PTY" },
@@ -745,8 +745,8 @@ check_duplicated_redirections(const char *name, size_t len,
        };
        int i = 0, j = sizeof(mixtures) / sizeof(mixtures[0]);
 
-       oldflags &= ~(RED_NOBUF|RED_EOF|RED_PTY);
-       newflags &= ~(RED_NOBUF|RED_EOF|RED_PTY);
+       oldflags &= ~(RED_FLUSH|RED_EOF|RED_PTY);
+       newflags &= ~(RED_FLUSH|RED_EOF|RED_PTY);
 
        for (i = 0; i < j; i++) {
                bool both_have_common = \
@@ -877,7 +877,7 @@ redirect_string(const char *str, size_t explen, bool 
not_string,
                                                (redirect_flags_t) rp->flag, 
(redirect_flags_t) tflag);
                        }
 
-                       if (((rp->flag & ~(RED_NOBUF|RED_EOF|RED_PTY)) == tflag
+                       if (((rp->flag & ~(RED_FLUSH|RED_EOF|RED_PTY)) == tflag
                            || (outflag != 0
                                && (rp->flag & (RED_FILE|RED_WRITE)) == 
outflag))) {
                                break;
@@ -951,7 +951,7 @@ redirect_string(const char *str, size_t explen, bool 
not_string,
 
                        /* set close-on-exec */
                        os_close_on_exec(fileno(rp->output.fp), str, "pipe", 
"to");
-                       rp->flag |= RED_NOBUF;
+                       rp->flag |= RED_FLUSH;
                        break;
                case redirect_pipein:
                        if (extfd >= 0) {
@@ -1032,7 +1032,7 @@ redirect_string(const char *str, size_t explen, bool 
not_string,
                                                close(fd);
                                }
                                if (rp->output.fp != NULL && os_isatty(fd))
-                                       rp->flag |= RED_NOBUF;
+                                       rp->flag |= RED_FLUSH;
 
                                /* Move rp to the head of the list. */
                                if (! new_rp && red_head != rp) {

http://git.sv.gnu.org/cgit/gawk.git/commit/?id=2480186827f4e5f9b4269426742d5f4985dcbe01

commit 2480186827f4e5f9b4269426742d5f4985dcbe01
Author: Arnold D. Robbins <arnold@skeeve.com>
Date:   Thu Feb 23 19:50:37 2023 +0200

    Improve finding an input parser.

diff --git a/ChangeLog b/ChangeLog
index 5cc2ba77..6e2b302b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2023-02-23         Arnold D. Robbins     <arnold@skeeve.com>
+
+       * io.c (find_input_parser): Improve check to see if iop is
+       already being handled by an input parser. Found by
+       code inspection.
+
 2023-02-09         Arnold D. Robbins     <arnold@skeeve.com>
 
        * main.c (usage): Include URL for source code in the message.
diff --git a/io.c b/io.c
index 2addce0c..0911899f 100644
--- a/io.c
+++ b/io.c
@@ -3178,7 +3178,7 @@ find_input_parser(IOBUF *iop)
        awk_input_parser_t *ip, *ip2;
 
        /* if already associated with an input parser, bail out early */
-       if (iop->public.get_record != NULL)
+       if (iop->public.get_record != NULL || iop->public.read_func != read)
                return;
 
        ip = ip2 = NULL;

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

Summary of changes:
 ChangeLog                        |  22 ++++++
 awk.h                            |   5 +-
 builtin.c                        |  25 ++++---
 doc/ChangeLog                    |   4 ++
 doc/gawk.info                    | 150 ++++++++++++++++++++-------------------
 doc/gawk.texi                    |   4 ++
 doc/gawktexi.in                  |   4 ++
 io.c                             |  14 ++--
 pc/ChangeLog                     |   4 ++
 pc/Makefile.tst                  |  12 +++-
 test/ChangeLog                   |   7 ++
 test/Makefile.am                 |   6 +-
 test/Makefile.in                 |  16 ++++-
 test/Maketests                   |  10 +++
 test/elemnew2.awk                |  15 ++++
 test/elemnew2.ok                 |   3 +
 test/elemnew3.awk                |   9 +++
 test/{stupid4.ok => elemnew3.ok} |   1 -
 18 files changed, 216 insertions(+), 95 deletions(-)
 create mode 100644 test/elemnew2.awk
 create mode 100644 test/elemnew2.ok
 create mode 100644 test/elemnew3.awk
 copy test/{stupid4.ok => elemnew3.ok} (57%)


hooks/post-receive
-- 
gawk



reply via email to

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