OSDN Git Service

buildsys: fixup unifdef state in skiphash, linenum
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Tue, 7 Jan 2014 18:47:31 +0000 (19:47 +0100)
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Tue, 7 Jan 2014 18:47:31 +0000 (19:47 +0100)
amend to fixup line-numbering in the unifdefile

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
extra/scripts/unifdef.c

index a653553..f18bea8 100644 (file)
@@ -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 == '#') {