diff options
author | Joris Vink <joris@cvs.openbsd.org> | 2005-10-10 14:16:04 +0000 |
---|---|---|
committer | Joris Vink <joris@cvs.openbsd.org> | 2005-10-10 14:16:04 +0000 |
commit | 936de9a6e61cfc4e5fcf477517660eed5e3f2ada (patch) | |
tree | 312271217108da4391bc272f577e05160892b598 /usr.bin/cvs | |
parent | 048cdec9b9dbd5bce2c83565ba43ebb9ba717a08 (diff) |
use rd_next in rcs_getrev() when patching to get to a revision
instead of just decrementing the revision number, as the previous revision
doesn't always follow the current revision - 1 rule.
ok niallo@
Diffstat (limited to 'usr.bin/cvs')
-rw-r--r-- | usr.bin/cvs/rcs.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/usr.bin/cvs/rcs.c b/usr.bin/cvs/rcs.c index ebbf57fa13a..34698f31855 100644 --- a/usr.bin/cvs/rcs.c +++ b/usr.bin/cvs/rcs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rcs.c,v 1.83 2005/10/10 13:41:25 joris Exp $ */ +/* $OpenBSD: rcs.c,v 1.84 2005/10/10 14:16:03 joris Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -1369,22 +1369,15 @@ rcs_getrev(RCSFILE *rfp, RCSNUM *frev) /* Apply patches backwards to get the right version. * This will need some rework to support sub branches. */ - if ((crev = rcsnum_alloc()) == NULL) { - cvs_buf_free(rbuf); - return (NULL); - } - rcsnum_cpy(rfp->rf_head, crev, 0); + crev = rdp->rd_next; do { - crev->rn_id[crev->rn_len - 1]--; rdp = rcs_findrev(rfp, crev); if (rdp == NULL) { - rcsnum_free(crev); cvs_buf_free(rbuf); return (NULL); } if (cvs_buf_putc(rbuf, '\0') < 0) { - rcsnum_free(crev); cvs_buf_free(rbuf); return (NULL); } @@ -1393,9 +1386,8 @@ rcs_getrev(RCSFILE *rfp, RCSNUM *frev) free(bp); if (rbuf == NULL) break; + crev = rdp->rd_next; } while (rcsnum_cmp(crev, rev, 0) != 0); - - rcsnum_free(crev); } /* |