Some cosmetic clean-up in the code.
[gedcom-parse.git] / gedcom_lex_common.c
index 58296331b732313651202cf5042a1234097c3889..1eeab459d8e6c8c1579e19a8050ada9dee47fcc0 100644 (file)
@@ -265,6 +265,10 @@ int test_loop(ENCODING enc, char* code)
       return CLOSE;                                                           \
     }                                                                         \
     else {                                                                    \
+      /* Reset our state */                                                   \
+      current_level = -1;                                                     \
+      level_diff = MAXGEDCLEVEL;                                              \
+      /* ... then terminate lex */                                            \
       yyterminate();                                                          \
     }                                                                         \
   }