version 1.2, 2010/10/20 06:51:26 |
version 1.3, 2010/10/20 19:53:53 |
|
|
size_t rp_tlen; |
size_t rp_tlen; |
|
|
struct rcs_delta *rp_delta; |
struct rcs_delta *rp_delta; |
FILE *rp_file; |
|
int rp_lineno; |
int rp_lineno; |
int rp_msglineno; |
int rp_msglineno; |
int rp_token; |
int rp_token; |
|
|
pdp->rp_token = -1; |
pdp->rp_token = -1; |
pdp->rp_lineno = 1; |
pdp->rp_lineno = 1; |
pdp->rp_msglineno = 1; |
pdp->rp_msglineno = 1; |
if ((pdp->rp_file = fdopen(rfp->rf_fd, "r")) == NULL) { |
|
xfree(pdp); |
|
return (1); |
|
} |
|
/* ditch the strict lock */ |
/* ditch the strict lock */ |
rfp->rf_flags &= ~RCS_SLOCK; |
rfp->rf_flags &= ~RCS_SLOCK; |
rfp->rf_pdata = pdp; |
rfp->rf_pdata = pdp; |
|
|
|
|
pdp = rfp->rf_pdata; |
pdp = rfp->rf_pdata; |
|
|
if (pdp->rp_file != NULL) |
|
(void)fclose(pdp->rp_file); |
|
if (pdp->rp_buf != NULL) |
if (pdp->rp_buf != NULL) |
xfree(pdp->rp_buf); |
xfree(pdp->rp_buf); |
if (pdp->rp_token == RCS_TYPE_REVISION) |
if (pdp->rp_token == RCS_TYPE_REVISION) |
|
|
*bp = '\0'; |
*bp = '\0'; |
|
|
for (;;) { |
for (;;) { |
c = getc(pdp->rp_file); |
c = getc(rfp->rf_file); |
if (c == '@') { |
if (c == '@') { |
c = getc(pdp->rp_file); |
c = getc(rfp->rf_file); |
if (c == EOF) { |
if (c == EOF) { |
return (EOF); |
return (EOF); |
} else if (c != '@') { |
} else if (c != '@') { |
ungetc(c, pdp->rp_file); |
ungetc(c, rfp->rf_file); |
break; |
break; |
} |
} |
} |
} |
|
|
c = EOF; |
c = EOF; |
do { |
do { |
pre = c; |
pre = c; |
c = getc(pdp->rp_file); |
c = getc(rfp->rf_file); |
if (c == EOF) { |
if (c == EOF) { |
if (ferror(pdp->rp_file)) { |
if (ferror(rfp->rf_file)) { |
rcsparse_warnx(rfp, "error during parsing"); |
rcsparse_warnx(rfp, "error during parsing"); |
return (0); |
return (0); |
} |
} |
|
|
switch (c) { |
switch (c) { |
case '@': |
case '@': |
ret = rcsparse_string(rfp, allowed); |
ret = rcsparse_string(rfp, allowed); |
if (ret == EOF && ferror(pdp->rp_file)) { |
if (ret == EOF && ferror(rfp->rf_file)) { |
rcsparse_warnx(rfp, "error during parsing"); |
rcsparse_warnx(rfp, "error during parsing"); |
return (0); |
return (0); |
} |
} |
|
|
|
|
for (;;) { |
for (;;) { |
if (c == EOF) { |
if (c == EOF) { |
if (ferror(pdp->rp_file)) |
if (ferror(rfp->rf_file)) |
rcsparse_warnx(rfp, "error during parsing"); |
rcsparse_warnx(rfp, "error during parsing"); |
else |
else |
rcsparse_warnx(rfp, "unexpected end of file"); |
rcsparse_warnx(rfp, "unexpected end of file"); |
|
|
|
|
RBUF_PUTC(c); |
RBUF_PUTC(c); |
|
|
c = getc(pdp->rp_file); |
c = getc(rfp->rf_file); |
|
|
if (isspace(c)) { |
if (isspace(c)) { |
if (c == '\n') |
if (c == '\n') |
|
|
RBUF_PUTC('\0'); |
RBUF_PUTC('\0'); |
break; |
break; |
} else if (c == ';' || c == ':' || c == ',') { |
} else if (c == ';' || c == ':' || c == ',') { |
ungetc(c, pdp->rp_file); |
ungetc(c, rfp->rf_file); |
RBUF_PUTC('\0'); |
RBUF_PUTC('\0'); |
break; |
break; |
} else if (!isgraph(c)) { |
} else if (!isgraph(c)) { |