From 6ac96eea2be7cea48b8cf4232c3be6699078173b Mon Sep 17 00:00:00 2001 From: Peter Verthez Date: Sun, 9 Feb 2003 15:55:56 +0000 Subject: [PATCH] Make sure that compatibility mode is only used during parse of a file. --- gedcom/compat.c | 6 ++++++ gedcom/compat.h | 1 + gedcom/gedcom.y | 8 ++++++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/gedcom/compat.c b/gedcom/compat.c index 3997fe6..2cbf818 100644 --- a/gedcom/compat.c +++ b/gedcom/compat.c @@ -269,6 +269,12 @@ int compat_mode(Compat_rule rule) return (compat_matrix[rule] & compatibility); } +void compat_close() +{ + compatibility_program = 0; + compatibility = 0; +} + /********************************************************************/ /* C_NO_SUBMITTER */ /********************************************************************/ diff --git a/gedcom/compat.h b/gedcom/compat.h index aaf8c49..055b0f0 100644 --- a/gedcom/compat.h +++ b/gedcom/compat.h @@ -57,6 +57,7 @@ void set_compatibility_program(const char* program); void set_compatibility_version(const char* version); void compute_compatibility(); int compat_mode(Compat_rule rule); +void compat_close(); /* C_NO_SUBMITTER */ void compat_generate_submitter_link(Gedcom_ctxt parent); diff --git a/gedcom/gedcom.y b/gedcom/gedcom.y index b94f7fa..bd6ea1d 100644 --- a/gedcom/gedcom.y +++ b/gedcom/gedcom.y @@ -422,9 +422,13 @@ void clean_up(); %% file : head_sect records trlr_sect - { if (fail == 1) YYABORT; } + { compat_close(); + if (fail == 1) YYABORT; + } | error - { clean_up(); } + { compat_close(); + clean_up(); + } ; records : /* empty */ -- 2.30.2