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-2610-gc51a97


From: Arnold Robbins
Subject: [gawk-diffs] [SCM] gawk branch, master, updated. gawk-4.1.0-2610-gc51a97f
Date: Wed, 9 Aug 2017 14:02:15 -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  c51a97fc72b732d19dbc83a7a4aadf9893a92b78 (commit)
       via  66a471664f2bf33b35a10db017a1f7ff194d5163 (commit)
      from  d391c4885fbfcca9116fcabdb970f0a96934efc9 (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=c51a97fc72b732d19dbc83a7a4aadf9893a92b78

commit c51a97fc72b732d19dbc83a7a4aadf9893a92b78
Author: Arnold D. Robbins <address@hidden>
Date:   Wed Aug 9 21:01:19 2017 +0300

    Fix array indexing from unassigned var to not keep that attribute.

diff --git a/ChangeLog b/ChangeLog
index 10bf087..3a05ca5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,12 @@
 
        * main.c (usage): Add URL for Bug reporting info to the help message.
 
+       Unrelated:
+
+       * str_array.c (str_lookup): Make a copy of the string if it
+       came from Nnull_string or a null field.  Thanks to
+       Daniel Pettet for the report.
+
 2017-08-04         Arnold D. Robbins     <address@hidden>
 
        * array.c, awk.h, awkgram.y, builtin.c, cint_array.c,
diff --git a/str_array.c b/str_array.c
index 55e9049..8d6d2b0 100644
--- a/str_array.c
+++ b/str_array.c
@@ -165,8 +165,13 @@ str_lookup(NODE *symbol, NODE *subs)
         * "Array indices are always strings."
         * ....
         */
-       if (subs->stfmt != STFMT_UNUSED) {
-               /* The string was generated using CONVFMT. */
+       // Special cases:
+       // 1. The string was generated using CONVFMT.
+       // 2. The string was from an unassigned variable.
+       // 3. The string was from an unassigned field.
+       if (   subs->stfmt != STFMT_UNUSED
+           || subs == Nnull_string
+           || (subs->flags & NULL_FIELD) != 0) {
                NODE *tmp;
 
                /*
diff --git a/test/ChangeLog b/test/ChangeLog
index b7225ce..e85aa68 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -2,6 +2,11 @@
 
        * badargs.ok: Update after code changes.
 
+       Unrelated:
+
+       * Makefile.am (aryunasgn): New test. 
+       * aryunasgn.awk, aryunasgn.ok: New files.
+
 2017-08-04         Arnold D. Robbins     <address@hidden>
 
        * Makefile.am: Update copyright year.
diff --git a/test/Makefile.am b/test/Makefile.am
index dddcf93..f519b0d 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1199,7 +1199,7 @@ BASIC_TESTS = \
        addcomma anchgsub anchor argarray arrayind1 arrayind2 arrayind3 
arrayparm arrayprm2 arrayprm3 \
        arrayref arrymem1 arryref2 arryref3 arryref4 arryref5 arynasty \
        arynocls aryprm1 aryprm2 aryprm3 aryprm4 aryprm5 aryprm6 aryprm7 \
-       aryprm8 aryprm9 arysubnm asgext awkpath \
+       aryprm8 aryprm9 arysubnm aryunasgn asgext awkpath \
        back89 backgsub badassign1 badbuild \
        callparam childin clobber closebad clsflnam compare compare2 concat1 
concat2 \
        concat3 concat4 concat5 convfmt \
diff --git a/test/Makefile.in b/test/Makefile.in
index 2b21e0a..a6e4f96 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -1456,7 +1456,7 @@ BASIC_TESTS = \
        addcomma anchgsub anchor argarray arrayind1 arrayind2 arrayind3 
arrayparm arrayprm2 arrayprm3 \
        arrayref arrymem1 arryref2 arryref3 arryref4 arryref5 arynasty \
        arynocls aryprm1 aryprm2 aryprm3 aryprm4 aryprm5 aryprm6 aryprm7 \
-       aryprm8 aryprm9 arysubnm asgext awkpath \
+       aryprm8 aryprm9 arysubnm aryunasgn asgext awkpath \
        back89 backgsub badassign1 badbuild \
        callparam childin clobber closebad clsflnam compare compare2 concat1 
concat2 \
        concat3 concat4 concat5 convfmt \
@@ -2990,6 +2990,11 @@ arysubnm:
        @AWKPATH="$(srcdir)" $(AWK) -f address@hidden  >_$@ 2>&1 || echo EXIT 
CODE: $$? >>_$@
        @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
 
+aryunasgn:
+       @echo $@
+       @AWKPATH="$(srcdir)" $(AWK) -f address@hidden  >_$@ 2>&1 || echo EXIT 
CODE: $$? >>_$@
+       @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
 asgext:
        @echo $@
        @AWKPATH="$(srcdir)" $(AWK) -f address@hidden  < 
"$(srcdir)"/address@hidden >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
diff --git a/test/Maketests b/test/Maketests
index f8c54f9..e6a2f30 100644
--- a/test/Maketests
+++ b/test/Maketests
@@ -130,6 +130,11 @@ arysubnm:
        @AWKPATH="$(srcdir)" $(AWK) -f address@hidden  >_$@ 2>&1 || echo EXIT 
CODE: $$? >>_$@
        @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
 
+aryunasgn:
+       @echo $@
+       @AWKPATH="$(srcdir)" $(AWK) -f address@hidden  >_$@ 2>&1 || echo EXIT 
CODE: $$? >>_$@
+       @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
 asgext:
        @echo $@
        @AWKPATH="$(srcdir)" $(AWK) -f address@hidden  < 
"$(srcdir)"/address@hidden >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
diff --git a/test/aryunasgn.awk b/test/aryunasgn.awk
new file mode 100644
index 0000000..ccb3fd2
--- /dev/null
+++ b/test/aryunasgn.awk
@@ -0,0 +1,17 @@
+BEGIN {
+    a[i] = "null"                         # i is initially undefined
+    for (i in a) {                        # i is null string
+        print length(i), a[i] # , typeof(i)  # 0 null
+        print (i==0), (i=="")             # 1 1  should be  0 1
+    }
+    print a[""]                           # null
+    print a[0]                            #
+
+    b[$2] = "null also"                   # $2 is also undefined
+    for (j in b) {
+        print length(j), a[j] # , typeof(i)  # 0 null
+        print (j==0), (j=="")             # 1 1  should be  0 1
+    }
+    print b[""]                           # null
+    print b[0]                            #
+}
diff --git a/test/aryunasgn.ok b/test/aryunasgn.ok
new file mode 100644
index 0000000..798c6de
--- /dev/null
+++ b/test/aryunasgn.ok
@@ -0,0 +1,8 @@
+0 null
+0 1
+null
+
+0 null
+0 1
+null also
+

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

commit 66a471664f2bf33b35a10db017a1f7ff194d5163
Author: Arnold D. Robbins <address@hidden>
Date:   Wed Aug 9 20:52:43 2017 +0300

    Add URL for bug reporting description to the help message.

diff --git a/ChangeLog b/ChangeLog
index abc0838..10bf087 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2017-08-09         Arnold D. Robbins     <address@hidden>
+
+       * main.c (usage): Add URL for Bug reporting info to the help message.
+
 2017-08-04         Arnold D. Robbins     <address@hidden>
 
        * array.c, awk.h, awkgram.y, builtin.c, cint_array.c,
diff --git a/main.c b/main.c
index 1b5dc43..cd03224 100644
--- a/main.c
+++ b/main.c
@@ -613,8 +613,10 @@ usage(int exitval, FILE *fp)
           for this application.  Please add _another line_ with the
           address for translation bugs.
           no-wrap */
-       fputs(_("\nTo report bugs, see node `Bugs' in `gawk.info', which is\n\
-section `Reporting Problems and Bugs' in the printed version.\n\n"), fp);
+       fputs(_("\nTo report bugs, see node `Bugs' in `gawk.info'\n\
+which is section `Reporting Problems and Bugs' in the\n\
+printed version.  This same information may be found at\n\
+https://www.gnu.org/software/gawk/manual/html_node/Bugs.html.\n\n";), fp);
 
        /* ditto */
        fputs(_("gawk is a pattern scanning and processing language.\n\
diff --git a/test/ChangeLog b/test/ChangeLog
index 0452eba..b7225ce 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,7 @@
+2017-08-09         Arnold D. Robbins     <address@hidden>
+
+       * badargs.ok: Update after code changes.
+
 2017-08-04         Arnold D. Robbins     <address@hidden>
 
        * Makefile.am: Update copyright year.
diff --git a/test/badargs.ok b/test/badargs.ok
index cd66dda..6b3d88b 100644
--- a/test/badargs.ok
+++ b/test/badargs.ok
@@ -31,8 +31,10 @@ Short options:               GNU long options: (extensions)
        -t                      --lint-old
        -V                      --version
 
-To report bugs, see node `Bugs' in `gawk.info', which is
-section `Reporting Problems and Bugs' in the printed version.
+To report bugs, see node `Bugs' in `gawk.info'
+which is section `Reporting Problems and Bugs' in the
+printed version.  This same information may be found at
+https://www.gnu.org/software/gawk/manual/html_node/Bugs.html.
 
 gawk is a pattern scanning and processing language.
 By default it reads standard input and writes standard output.

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

Summary of changes:
 ChangeLog          | 10 ++++++++++
 main.c             |  6 ++++--
 str_array.c        |  9 +++++++--
 test/ChangeLog     |  9 +++++++++
 test/Makefile.am   |  2 +-
 test/Makefile.in   |  7 ++++++-
 test/Maketests     |  5 +++++
 test/aryunasgn.awk | 17 +++++++++++++++++
 test/aryunasgn.ok  |  8 ++++++++
 test/badargs.ok    |  6 ++++--
 10 files changed, 71 insertions(+), 8 deletions(-)
 create mode 100644 test/aryunasgn.awk
 create mode 100644 test/aryunasgn.ok


hooks/post-receive
-- 
gawk



reply via email to

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