]> git.pond.sub.org Git - empserver/commitdiff
(xundump, xundump1): Fix treatment of empty lines.
authorMarkus Armbruster <armbru@pond.sub.org>
Thu, 9 Feb 2006 07:10:18 +0000 (07:10 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Thu, 9 Feb 2006 07:10:18 +0000 (07:10 +0000)
src/lib/common/xundump.c

index 948c8a767df37c42154ce3a039be70cdd77607be..27b70142494176bf62410caedd9718a7d9a209bb 100644 (file)
@@ -593,7 +593,7 @@ int
 xundump(FILE *fp, char *file, int expected_table)
 {
     struct castr *ca;
-    int type, nca, i;
+    int type, nca, i, ch;
 
     if (fname != file) {
         fname = file;
@@ -619,6 +619,9 @@ xundump(FILE *fp, char *file, int expected_table)
 
     cur_type = type;
     if (human) {
+       while ((ch = skipfs(fp)) == '\n')
+           lineno++;
+       ungetc(ch, fp);
        if (xuflds(fp, xufldname) < 0)
            type = EF_BAD;
     } else {
@@ -656,7 +659,8 @@ xundump1(FILE *fp, int type, struct castr *ca)
     int row, ch;
 
     for (row = 0;; ++row) {
-       ch = skipfs(fp);
+       while ((ch = skipfs(fp)) == '\n')
+           lineno++;
        if (ch == '/')
            break;
        ungetc(ch, fp);