From 08e9f6f368dcd3bb95c9f68e666ca1a0fb5d6df6 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Tue, 7 Jan 2014 19:47:31 +0100 Subject: buildsys: fixup unifdef state in skiphash, linenum amend to fixup line-numbering in the unifdefile Signed-off-by: Bernhard Reutner-Fischer --- extra/scripts/unifdef.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'extra/scripts/unifdef.c') diff --git a/extra/scripts/unifdef.c b/extra/scripts/unifdef.c index a65355366..f18bea853 100644 --- a/extra/scripts/unifdef.c +++ b/extra/scripts/unifdef.c @@ -1097,12 +1097,14 @@ skiphash(void) { const char *cp; - linenum++; - if (linestate == LS_START && fgets(tline, MAXLINE, input) == NULL) { - if (ferror(input)) - err(2, "can't read %s", filename); - else - return (NULL); + if (linestate == LS_START) { + linenum++; + if (fgets(tline, MAXLINE, input) == NULL) { + if (ferror(input)) + err(2, "can't read %s", filename); + else + return (NULL); + } } cp = skipcomment(tline); if (linestate == LS_START && *cp == '#') { -- cgit v1.2.3