From 8fa0dcbe17a1d2e2e83f8eb399d15e99ca823cc1 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sun, 4 Jun 2006 08:37:37 +0000 Subject: [PATCH] Don't check values for immutable fields match when initializing an empty table: (initialized): New. (xundump): Set it. (fldval_must_match): Ignore NSC_CONST when it's clear. --- src/lib/common/xundump.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/common/xundump.c b/src/lib/common/xundump.c index bc33ef33..58eb3609 100644 --- a/src/lib/common/xundump.c +++ b/src/lib/common/xundump.c @@ -62,6 +62,7 @@ #include "optlist.h" #include "prototypes.h" +static unsigned char initialized[EF_MAX]; static char *fname; static int lineno; static int human; @@ -400,7 +401,8 @@ fldval_must_match(int fldno) struct castr *ca = ef_cadef(cur_type); int i = fldca[fldno] - ca; - return (fldca[fldno]->ca_flags & NSC_CONST) || caseen[i]; + return (initialized[cur_type] && (fldca[fldno]->ca_flags & NSC_CONST)) + || caseen[i]; } static void * @@ -782,6 +784,7 @@ xundump(FILE *fp, char *file, int expected_table) lineno++; ungetc(ch, fp); + initialized[type] = 1; return type; }