--- libaitcfg/src/parse.c 2012/07/30 09:40:19 1.8.4.1 +++ libaitcfg/src/parse.c 2012/07/30 10:45:16 1.8.4.2 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: parse.c,v 1.8.4.1 2012/07/30 09:40:19 misho Exp $ +* $Id: parse.c,v 1.8.4.2 2012/07/30 10:45:16 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -367,7 +367,7 @@ cfgReadLines(FILE *f, const char *delim, const char *e memset(line, 0, sizeof line); fgets(line, sizeof line - 1, f); /* check for user end-of-file */ - if (!strcmp(line, end)) + if (!strspn(line, end)) break; if (!(psAttr = strpbrk(line, "\r\n"))) { @@ -376,10 +376,9 @@ cfgReadLines(FILE *f, const char *delim, const char *e } else { *psAttr = 0; io_TrimStr(line); + if (!*line) + continue; } - /* check for comment or empty line */ - if (!*line) - continue; ret = io_MakeAV2((char**) &line, delim, psAttr, psVal); io_LTrimStr(psVal);