gawk-diffs
[Top][All Lists]
Advanced

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

[SCM] gawk branch, gawk-5.1-stable, updated. gawk-4.1.0-4014-g96a1c9b


From: Arnold Robbins
Subject: [SCM] gawk branch, gawk-5.1-stable, updated. gawk-4.1.0-4014-g96a1c9b
Date: Tue, 7 Jul 2020 14:59:10 -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, gawk-5.1-stable has been updated
       via  96a1c9be7fced9d099dae2354d7d643ce68b8903 (commit)
      from  54483c688b659b96cc930000444d5b34ee11d11c (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=96a1c9be7fced9d099dae2354d7d643ce68b8903

commit 96a1c9be7fced9d099dae2354d7d643ce68b8903
Author: Arnold D. Robbins <arnold@skeeve.com>
Date:   Tue Jul 7 21:58:44 2020 +0300

    Fix another MPFR number parsing issue.

diff --git a/ChangeLog b/ChangeLog
index 9d6df8c..e4f980c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,12 @@
        * awk.h: Turn all the flag defines into enums. GDB can then show
        the bit maps directly.
 
+       Unrelated: Fix another MFPF bug, reported by Hyunho Cho
+       <mug896@naver.com>.
+
+       * mpfr.c (force_mpnum): Restore the character at the end of
+       the string if only saw + or -.
+
 2020-07-07         Andrew J. Schorr      <aschorr@telemetry-investments.com>
 
        * node.c (r_dupnode): Sanitize the code, particularly for MPFR.
diff --git a/mpfr.c b/mpfr.c
index be2b81b..3b4258c 100644
--- a/mpfr.c
+++ b/mpfr.c
@@ -298,8 +298,11 @@ force_mpnum(NODE *n, int do_nondec, int use_locale)
         * won't check for that and set errno, so we have
         * to check manuall.
         */
-       if (*cp1 == '\0')
+       if (*cp1 == '\0') {
+               *cpend = save;
+               mpg_zero(n);
                return false;
+       }
 
        if (do_nondec)
                base = get_numbase(cp1, cpend - cp1, use_locale);
diff --git a/test/ChangeLog b/test/ChangeLog
index 9a9922f..b741651 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
+2020-07-07         Arnold D. Robbins     <arnold@skeeve.com>
+
+       * Makefile.am (EXTRA_DIST): New test, mpfrcase2.
+       * mpfrcase2.awk, mpfrcase2.in, mpfrcase2.ok: New files.
+
 2020-07-06         Andrew J. Schorr      <aschorr@telemetry-investments.com>
 
        * Makefile.am (AWK): Append $(GAWK_TEST_ARGS) to enable running
diff --git a/test/Makefile.am b/test/Makefile.am
index b7e3240..7663492 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -703,6 +703,9 @@ EXTRA_DIST = \
        mpfrcase.awk \
        mpfrcase.in \
        mpfrcase.ok \
+       mpfrcase2.awk \
+       mpfrcase2.in \
+       mpfrcase2.ok \
        mpfrexprange.awk \
        mpfrexprange.ok \
        mpfrfield.awk \
@@ -1467,7 +1470,7 @@ NEED_LINT = \
 NEED_LINT_OLD = lintold
 
 # List of tests that must be run with -M
-NEED_MPFR = mpfrbigint mpfrbigint2 mpfrcase mpfrexprange mpfrfield mpfrieee 
mpfrmemok1 \
+NEED_MPFR = mpfrbigint mpfrbigint2 mpfrcase mpfrcase2 mpfrexprange mpfrfield 
mpfrieee mpfrmemok1 \
        mpfrnegzero mpfrnonum mpfrnr mpfrrem mpfrrnd mpfrrndeval mpfrsort 
mpfrsqrt \
        mpfrstrtonum mpgforcenum mpfruplus mpfranswer42
 
diff --git a/test/Makefile.in b/test/Makefile.in
index afa233f..4af1a7b 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -966,6 +966,9 @@ EXTRA_DIST = \
        mpfrcase.awk \
        mpfrcase.in \
        mpfrcase.ok \
+       mpfrcase2.awk \
+       mpfrcase2.in \
+       mpfrcase2.ok \
        mpfrexprange.awk \
        mpfrexprange.ok \
        mpfrfield.awk \
@@ -1728,7 +1731,7 @@ NEED_LINT = \
 NEED_LINT_OLD = lintold
 
 # List of tests that must be run with -M
-NEED_MPFR = mpfrbigint mpfrbigint2 mpfrcase mpfrexprange mpfrfield mpfrieee 
mpfrmemok1 \
+NEED_MPFR = mpfrbigint mpfrbigint2 mpfrcase mpfrcase2 mpfrexprange mpfrfield 
mpfrieee mpfrmemok1 \
        mpfrnegzero mpfrnonum mpfrnr mpfrrem mpfrrnd mpfrrndeval mpfrsort 
mpfrsqrt \
        mpfrstrtonum mpgforcenum mpfruplus mpfranswer42
 
@@ -5124,6 +5127,11 @@ mpfrcase:
        @AWKPATH="$(srcdir)" $(AWK) -f $@.awk  -M < "$(srcdir)"/$@.in >_$@ 2>&1 
|| echo EXIT CODE: $$? >>_$@
        @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
 
+mpfrcase2:
+       @echo $@
+       @AWKPATH="$(srcdir)" $(AWK) -f $@.awk  -M < "$(srcdir)"/$@.in >_$@ 2>&1 
|| echo EXIT CODE: $$? >>_$@
+       @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
 mpfrfield:
        @echo $@
        @AWKPATH="$(srcdir)" $(AWK) -f $@.awk  -M < "$(srcdir)"/$@.in >_$@ 2>&1 
|| echo EXIT CODE: $$? >>_$@
diff --git a/test/Maketests b/test/Maketests
index 7fb3b3a..0b98f78 100644
--- a/test/Maketests
+++ b/test/Maketests
@@ -2241,6 +2241,11 @@ mpfrcase:
        @AWKPATH="$(srcdir)" $(AWK) -f $@.awk  -M < "$(srcdir)"/$@.in >_$@ 2>&1 
|| echo EXIT CODE: $$? >>_$@
        @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
 
+mpfrcase2:
+       @echo $@
+       @AWKPATH="$(srcdir)" $(AWK) -f $@.awk  -M < "$(srcdir)"/$@.in >_$@ 2>&1 
|| echo EXIT CODE: $$? >>_$@
+       @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
 mpfrfield:
        @echo $@
        @AWKPATH="$(srcdir)" $(AWK) -f $@.awk  -M < "$(srcdir)"/$@.in >_$@ 2>&1 
|| echo EXIT CODE: $$? >>_$@
diff --git a/test/mpfrcase2.awk b/test/mpfrcase2.awk
new file mode 100644
index 0000000..5292448
--- /dev/null
+++ b/test/mpfrcase2.awk
@@ -0,0 +1,19 @@
+{
+    for (i = 1; i <= NF; i++) {
+        switch ($i) {
+            case "+" : case "-" :
+            case "*" : case "/" :
+            case "%" : case "^" :
+                printf $i; break
+            case /[a-z]/ :
+                printf $i; break
+            case /[0-9]/ : 
+                printf $i; break
+            case /[ \t]/ :
+                printf $i; break
+            default :
+                print " wrong character " i " th: "  $i
+        }
+    }
+    print ""
+}
diff --git a/test/mpfrcase2.in b/test/mpfrcase2.in
new file mode 100644
index 0000000..6ad0de2
--- /dev/null
+++ b/test/mpfrcase2.in
@@ -0,0 +1 @@
+12+45
diff --git a/test/mpfrcase2.ok b/test/mpfrcase2.ok
new file mode 100644
index 0000000..6ad0de2
--- /dev/null
+++ b/test/mpfrcase2.ok
@@ -0,0 +1 @@
+12+45

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

Summary of changes:
 ChangeLog          |  6 ++++++
 mpfr.c             |  5 ++++-
 test/ChangeLog     |  5 +++++
 test/Makefile.am   |  5 ++++-
 test/Makefile.in   | 10 +++++++++-
 test/Maketests     |  5 +++++
 test/mpfrcase2.awk | 19 +++++++++++++++++++
 test/mpfrcase2.in  |  1 +
 test/mpfrcase2.ok  |  1 +
 9 files changed, 54 insertions(+), 3 deletions(-)
 create mode 100644 test/mpfrcase2.awk
 create mode 100644 test/mpfrcase2.in
 create mode 100644 test/mpfrcase2.ok


hooks/post-receive
-- 
gawk



reply via email to

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