X-Git-Url: https://git.dlugolecki.net.pl/?a=blobdiff_plain;f=multilex.c;h=a6ea0faa20caa258deadb7640659f7008f68e507;hb=378e28008bafd5b6a1a73bb3c37761fc08520b10;hp=60bb0a32bd8672d6819e66d41e78bb88c6c5995f;hpb=d2233f145e24a310889e4cc650365077786da3d9;p=gedcom-parse.git diff --git a/multilex.c b/multilex.c index 60bb0a3..a6ea0fa 100644 --- a/multilex.c +++ b/multilex.c @@ -10,11 +10,11 @@ /* $Id$ */ /* $Name$ */ -#include "gedcom.h" +#include "gedcom_internal.h" #include "multilex.h" #include "encoding.h" -int line_no = 1; +int line_no; typedef int (*lex_func)(void); lex_func lf; @@ -98,6 +98,7 @@ int gedcom_parse_file(char* file_name) ENCODING enc; int result = 1; FILE* file = fopen (file_name, "r"); + line_no = 1; if (!file) { gedcom_error("Could not open file '%s'\n", file_name); return 1; @@ -110,6 +111,7 @@ int gedcom_parse_file(char* file_name) result = gedcom_parse(); } lexer_close(); + fclose(file); return result; }