summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2020-07-08 11:09:21 +0300
committerArnold D. Robbins <arnold@skeeve.com>2020-07-08 11:09:21 +0300
commiteead4c7f6e29955a1a9578904a95c6291e8057b5 (patch)
treef9da47cdf242d962dd531a1447d315cdb6d6c906
parent5f67f8e055a5044d44d4bdb6d86a8c96a89046a9 (diff)
downloadgawk-eead4c7f6e29955a1a9578904a95c6291e8057b5.tar.gz
Fix printfchar test for -M.
-rw-r--r--ChangeLog5
-rw-r--r--str_array.c4
2 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index e4f980c5..1ac0efb9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2020-07-08 Arnold D. Robbins <arnold@skeeve.com>
+
+ * str_array.c (str_lookup): If a pure number, copy to a string. Fixes
+ at least printfchar test for MPFR, possibly some others.
+
2020-07-07 Arnold D. Robbins <arnold@skeeve.com>
* awk.h: Turn all the flag defines into enums. GDB can then show
diff --git a/str_array.c b/str_array.c
index c90f7861..84bd2f02 100644
--- a/str_array.c
+++ b/str_array.c
@@ -168,9 +168,11 @@ str_lookup(NODE *symbol, NODE *subs)
// 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.
+ // 3. The string was from a straight number, perniciously, from MPFR
+ // 4. The string was from an unassigned field.
if ( subs->stfmt != STFMT_UNUSED
|| subs == Nnull_string
+ || (subs->flags & STRING) == 0
|| (subs->flags & NULL_FIELD) != 0) {
NODE *tmp;