Make sure that compatibility mode is only used during parse of a file.
authorPeter Verthez <Peter.Verthez@advalvas.be>
Sun, 9 Feb 2003 15:55:56 +0000 (15:55 +0000)
committerPeter Verthez <Peter.Verthez@advalvas.be>
Sun, 9 Feb 2003 15:55:56 +0000 (15:55 +0000)
gedcom/compat.c
gedcom/compat.h
gedcom/gedcom.y

index 3997fe695278d589e838a7f0e470125339b20f78..2cbf8185ff1ee9b8a7af3eed288a1b5e99da789c 100644 (file)
@@ -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                                                  */
 /********************************************************************/
index aaf8c49d2b637279b147316f2e381abbf8797f52..055b0f0d1a7baf09f675d4f90f67b71600a1c978 100644 (file)
@@ -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);
index b94f7fa37c612217c3d1c036e5084375037f4bd0..bd6ea1d3d922970796af5d9743cda8d69bcab726 100644 (file)
@@ -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 */