(xundump): Count lines in a saner way: pass line number in and out.

Callers changed.
This commit is contained in:
Markus Armbruster 2007-08-05 16:22:41 +00:00
parent 6498d66263
commit 971515ccc9
3 changed files with 12 additions and 11 deletions

View file

@ -29,7 +29,7 @@
*
* Known contributors to this file:
* Ron Koenderink, 2005
* Markus Armbruster, 2005-2006
* Markus Armbruster, 2005-2007
*/
/*
@ -737,15 +737,13 @@ xutrailer(FILE *fp, int type, int row)
}
int
xundump(FILE *fp, char *file, int expected_table)
xundump(FILE *fp, char *file, int *plno, int expected_table)
{
struct castr *ca;
int type, nca, nf, i, ch;
if (fname != file) {
fname = file;
lineno = 1;
}
fname = file;
lineno = *plno;
if ((type = xuheader(fp, expected_table)) < 0)
return type;
@ -779,6 +777,7 @@ xundump(FILE *fp, char *file, int expected_table)
lineno++;
ungetc(ch, fp);
*plno = lineno;
return type;
}