]> git.pond.sub.org Git - empserver/commitdiff
(xutrailer): Fix parsing of /config. Change human-readable syntax not
authorMarkus Armbruster <armbru@pond.sub.org>
Wed, 8 Feb 2006 21:53:04 +0000 (21:53 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Wed, 8 Feb 2006 21:53:04 +0000 (21:53 +0000)
to accept number of records.  Don't skip empty lines after trailer.

src/lib/common/xundump.c

index 066e5509f8daff772059ae53064c2fc345d98082..a79a05d1a604ae4e0135aa7e29fec7532d92b76e 100644 (file)
@@ -693,16 +693,9 @@ xutrailer(FILE *fp, int type, int row)
 
     res = -1;
     if (human) {
-       if (fscanf(fp, "config%n",  &res) != 0) {
-           return gripe("Malformed table footer");
-       }
-    }
-    ch = skipfs(fp);
-    if (!isdigit(ch)) {
-        if (ch != '\n' || !human)
+       if (fscanf(fp, "config%n",  &res) != 0 || res < 0)
            return gripe("Malformed table footer");
     } else {
-        ungetc(ch, fp);
        if (fscanf(fp, "%d", &rows) != 1)
            return gripe("Malformed table footer");
        if (row != rows)
@@ -711,9 +704,7 @@ xutrailer(FILE *fp, int type, int row)
     }
     if (skipfs(fp) != '\n')
        return gripe("Junk after table footer");
-
-    while ((ch = skipfs(fp)) == '\n') ;
-    ungetc(ch, fp);
+    lineno++;
 
     return 0;
 }