Make sure that compatibility mode is only used during parse of a file.
[gedcom-parse.git] / gedcom / gedcom.y
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 */