gawk/Fix-problem-with-MPFR-conversion-to-int-from-hex-num.patch
2019-09-30 10:39:14 -04:00

38 lines
1.1 KiB
Diff

From da86689ae1669c27f0bf0c975d5e3d1e10058dfd Mon Sep 17 00:00:00 2001
From: "Arnold D. Robbins" <arnold@skeeve.com>
Date: Thu, 27 Sep 2018 14:51:00 +0300
Subject: [PATCH 141/289] Fix problem with MPFR conversion to int from hex
numbers.
---
ChangeLog | 6 ++++++
mpfr.c | 2 +-
test/ChangeLog | 5 +++++
test/Makefile.am | 7 +++++--
test/Makefile.in | 12 ++++++++++--
test/Maketests | 5 +++++
test/mpfrbigint2.awk | 3 +++
test/mpfrbigint2.in | 1 +
test/mpfrbigint2.ok | 3 +++
9 files changed, 39 insertions(+), 5 deletions(-)
create mode 100644 test/mpfrbigint2.awk
create mode 100644 test/mpfrbigint2.in
create mode 100644 test/mpfrbigint2.ok
diff --git a/mpfr.c b/mpfr.c
index b6e9c16e..8478570f 100644
--- a/mpfr.c
+++ b/mpfr.c
@@ -296,7 +296,7 @@ force_mpnum(NODE *n, int do_nondec, int use_locale)
if (do_nondec)
base = get_numbase(cp1, cpend - cp1, use_locale);
- if (! mpg_maybe_float(cp1, use_locale)) {
+ if (base != 10 || ! mpg_maybe_float(cp1, use_locale)) {
mpg_zero(n);
errno = 0;
mpg_strtoui(n->mpg_i, cp1, cpend - cp1, & ptr, base);
--
2.19.1