X-Git-Url: https://git.dlugolecki.net.pl/?a=blobdiff_plain;f=gedcom_lex_common.c;h=5d734c44689adb6e8fe9ae0b46c9bb15594af1f9;hb=c75da58b11b6b5f18e1d3f2200aa1e2f9ba5ac64;hp=58296331b732313651202cf5042a1234097c3889;hpb=d38733b97417d5495142cf3a75d6e43d989a140a;p=gedcom-parse.git diff --git a/gedcom_lex_common.c b/gedcom_lex_common.c index 5829633..5d734c4 100644 --- a/gedcom_lex_common.c +++ b/gedcom_lex_common.c @@ -12,10 +12,11 @@ #ifndef IN_LEX -#include "gedcom.tab.h" -#include "gedcom.h" +#include "gedcom_internal.h" #include "multilex.h" #include "encoding.h" +#include "gedcom.h" +#include "gedcom.tab.h" #define YY_NO_UNPUT @@ -265,6 +266,10 @@ int test_loop(ENCODING enc, char* code) return CLOSE; \ } \ else { \ + /* Reset our state */ \ + current_level = -1; \ + level_diff = MAXGEDCLEVEL; \ + /* ... then terminate lex */ \ yyterminate(); \ } \ }