summaryrefslogtreecommitdiffstats
path: root/contrib/csup/rcsparse.c
diff options
context:
space:
mode:
authorlulf <lulf@FreeBSD.org>2009-01-02 12:40:58 +0000
committerlulf <lulf@FreeBSD.org>2009-01-02 12:40:58 +0000
commitf67ab72faf5803d2034f0aca36255d6710a395ca (patch)
treef553a0280d902cb49fd2c1b3dac838af19672bf9 /contrib/csup/rcsparse.c
parentfd8c0b9c3abd1f219f008e71e7c8119d9032be3b (diff)
downloadFreeBSD-src-f67ab72faf5803d2034f0aca36255d6710a395ca.zip
FreeBSD-src-f67ab72faf5803d2034f0aca36255d6710a395ca.tar.gz
- Add an optimization when parsing rcsfiles when the intention is to only send
details to the cvsup server. The deltatext does not need parsing, and some parts of the rcsfile data structure doesn't need to be set up. - Fix a bug where the RCS expansion mode is not written out.
Diffstat (limited to 'contrib/csup/rcsparse.c')
-rw-r--r--contrib/csup/rcsparse.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/contrib/csup/rcsparse.c b/contrib/csup/rcsparse.c
index 1e855f9..19aa8b5 100644
--- a/contrib/csup/rcsparse.c
+++ b/contrib/csup/rcsparse.c
@@ -82,7 +82,7 @@ duptext(yyscan_t *sp, int *arglen)
* Start up parser, and use the rcsfile hook to add objects.
*/
int
-rcsparse_run(struct rcsfile *rf, FILE *infp)
+rcsparse_run(struct rcsfile *rf, FILE *infp, int ro)
{
yyscan_t scanner;
char *desc;
@@ -99,9 +99,12 @@ rcsparse_run(struct rcsfile *rf, FILE *infp)
rcsfile_setval(rf, RCSFILE_DESC, desc);
free(desc);
tok = rcslex(scanner);
- error = parse_deltatexts(rf, &scanner, tok);
- if (error)
- return (error);
+ /* Parse deltatexts if we need to edit. */
+ if (!ro) {
+ error = parse_deltatexts(rf, &scanner, tok);
+ if (error)
+ return (error);
+ }
rcslex_destroy(scanner);
return (0);
}
OpenPOWER on IntegriCloud