(xundump1, xundump2): Move call of xutrailer() from xundump1() to its

caller xundump2().  Make xundump1() return number of records read for
that.
This commit is contained in:
Markus Armbruster 2007-08-05 17:19:52 +00:00
parent 5a8aea24f4
commit 8fead20ac4

View file

@ -784,13 +784,15 @@ xundump(FILE *fp, char *file, int *plno, int expected_table)
static int static int
xundump2(FILE *fp, int type, struct castr *ca) xundump2(FILE *fp, int type, struct castr *ca)
{ {
int i; int recs, i;
is_partial = 0; is_partial = 0;
for (;;) { for (;;) {
if (xuheader1(fp, ca) < 0) if (xuheader1(fp, ca) < 0)
return -1; return -1;
if (xundump1(fp) < 0) if ((recs = xundump1(fp)) < 0)
return -1;
if (xutrailer(fp, recs) < 0)
return -1; return -1;
if (!ellipsis) if (!ellipsis)
return 0; return 0;
@ -842,8 +844,5 @@ xundump1(FILE *fp)
memset(ep->cache + ep->size * n, 0, ep->size); memset(ep->cache + ep->size * n, 0, ep->size);
} }
if (xutrailer(fp, row) < 0) return row;
return -1;
return 0;
} }