(xutrailer): Fix parsing of /config. Change human-readable syntax not
to accept number of records. Don't skip empty lines after trailer.
This commit is contained in:
parent
72127c838f
commit
d329c4f8e6
1 changed files with 2 additions and 11 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue