From 92b5353bf364897f02003c4116cabe6d48ea17eb Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Thu, 30 Jun 2016 09:59:47 -0400 Subject: Use new STFMT_UNUSED define to improve code clarity, and fix some minor stfmt issues. --- field.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'field.c') diff --git a/field.c b/field.c index 6a9516d0..931bafcc 100644 --- a/field.c +++ b/field.c @@ -288,7 +288,7 @@ set_record(const char *buf, int cnt) n->stlen = cnt; n->valref = 1; n->type = Node_val; - n->stfmt = -1; + n->stfmt = STFMT_UNUSED; n->flags = (STRING|STRCUR|MAYBE_NUM|FIELD); fields_arr[0] = n; -- cgit v1.2.3 From f34cb4d3ef340a58dae88f426543c05c4e09f6dd Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Sun, 3 Jul 2016 10:58:31 -0400 Subject: Fix bug where STRING flag was disabled during record reconstruction, and add test case. --- field.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'field.c') diff --git a/field.c b/field.c index 931bafcc..5e5a3511 100644 --- a/field.c +++ b/field.c @@ -216,7 +216,11 @@ rebuild_record() } } else { *n = *r; - n->flags &= ~(MALLOC|STRING); + if (n->flags & MALLOC) { + /* unexpected, since FIELD is on! */ + warning(_("invalid flags combination `%s' detected while rebuilding record; please file a bug report."), flags2str(n->flags)); + n->flags &= ~MALLOC; + } } n->stptr = cops; -- cgit v1.2.3 From ff4e0706c5ee5dffd69168ebd0ff5f53e474d048 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Sun, 3 Jul 2016 16:51:23 -0400 Subject: Revert warning message until I'm certain that that flag combo is invalid. --- field.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'field.c') diff --git a/field.c b/field.c index 5e5a3511..892818f7 100644 --- a/field.c +++ b/field.c @@ -216,11 +216,7 @@ rebuild_record() } } else { *n = *r; - if (n->flags & MALLOC) { - /* unexpected, since FIELD is on! */ - warning(_("invalid flags combination `%s' detected while rebuilding record; please file a bug report."), flags2str(n->flags)); - n->flags &= ~MALLOC; - } + n->flags &= ~MALLOC; } n->stptr = cops; -- cgit v1.2.3