Browse Source

buildsys: fixup unifdef state in skiphash, linenum

amend to fixup line-numbering in the unifdefile

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Bernhard Reutner-Fischer 10 years ago
parent
commit
08e9f6f368
1 changed files with 8 additions and 6 deletions
  1. 8 6
      extra/scripts/unifdef.c

+ 8 - 6
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 == '#') {