diff options
author | Joris Vink <joris@cvs.openbsd.org> | 2005-09-29 15:29:21 +0000 |
---|---|---|
committer | Joris Vink <joris@cvs.openbsd.org> | 2005-09-29 15:29:21 +0000 |
commit | ad097bd87e2f549cb7176c9bed4fa7934cfc640d (patch) | |
tree | bf9600f9f66a34b573ddf70ed2d724caba56eb97 /usr.bin/cvs/rcs.c | |
parent | 3bf4d3a58386446b6560e5c5e9227beb981aa524 (diff) |
allow RCS_HEAD_REV to be passed to rcs_getrev() to obtain the head revision;
Diffstat (limited to 'usr.bin/cvs/rcs.c')
-rw-r--r-- | usr.bin/cvs/rcs.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/usr.bin/cvs/rcs.c b/usr.bin/cvs/rcs.c index 828bedba619..e4be000c8f7 100644 --- a/usr.bin/cvs/rcs.c +++ b/usr.bin/cvs/rcs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rcs.c,v 1.65 2005/09/19 15:47:14 niallo Exp $ */ +/* $OpenBSD: rcs.c,v 1.66 2005/09/29 15:29:20 joris Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -1214,12 +1214,12 @@ rcs_patch_lines(struct rcs_foo *dlines, struct rcs_foo *plines) * cvs_buf_free() once the caller is done using it. */ BUF* -rcs_getrev(RCSFILE *rfp, RCSNUM *rev) +rcs_getrev(RCSFILE *rfp, RCSNUM *frev) { int expmode, res; size_t len; void *bp; - RCSNUM *crev; + RCSNUM *crev, *rev; BUF *rbuf, *dbuf = NULL; struct rcs_delta *rdp = NULL; struct rcs_foo *lines; @@ -1229,6 +1229,11 @@ rcs_getrev(RCSFILE *rfp, RCSNUM *rev) if (rfp->rf_head == NULL) return (NULL); + if (frev == RCS_HEAD_REV) + rev = rfp->rf_head; + else + rev = frev; + res = rcsnum_cmp(rfp->rf_head, rev, 0); if (res == 1) { rcs_errno = RCS_ERR_NOENT; |