summaryrefslogtreecommitdiff
path: root/mpfr.c
diff options
context:
space:
mode:
Diffstat (limited to 'mpfr.c')
-rw-r--r--mpfr.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/mpfr.c b/mpfr.c
index 7f61b692..40833124 100644
--- a/mpfr.c
+++ b/mpfr.c
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 2012, 2013, 2015, 2017, 2018, 2019, 2021
+ * Copyright (C) 2012, 2013, 2015, 2017, 2018, 2019, 2021, 2022,
* the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
@@ -349,6 +349,15 @@ mpg_force_number(NODE *n)
{
char *cp, *cpend;
+ if (n->type == Node_elem_new) {
+ n->type = Node_val;
+ n->flags &= ~STRING;
+ n->stptr[0] = '0'; // STRCUR is still set
+ n->stlen = 1;
+
+ return n;
+ }
+
if ((n->flags & NUMCUR) != 0)
return n;
n->flags |= NUMCUR;