X-Git-Url: https://git.dlugolecki.net.pl/?a=blobdiff_plain;f=multilex.c;h=8cac810164dfdf79ca18a50c051ac180285cfa34;hb=6ecd50de9c5c892d2df4fe0a10b671613c18d51d;hp=b0097cc871855d04ea0cd59af47c2ec812ad44f7;hpb=a54348309c92f4d7a2dd66b4055122a7be19ca28;p=gedcom-parse.git diff --git a/multilex.c b/multilex.c index b0097cc..8cac810 100644 --- a/multilex.c +++ b/multilex.c @@ -1,3 +1,12 @@ +/* This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + + (C) 2001 by The Genes Development Team + Original author: Peter Verthez (Peter.Verthez@advalvas.be) +*/ + /* $Id$ */ /* $Name$ */ @@ -5,7 +14,7 @@ #include "multilex.h" #include "encoding.h" -int line_no = 1; +int line_no; typedef int (*lex_func)(void); lex_func lf; @@ -89,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; @@ -101,6 +111,7 @@ int gedcom_parse_file(char* file_name) result = gedcom_parse(); } lexer_close(); + fclose(file); return result; }