From c6595ffe2828e517e0c6ce431ea15b0ad113c9df Mon Sep 17 00:00:00 2001 From: nicm Date: Sat, 31 Jul 2010 11:37:37 +0000 Subject: [PATCH] When looking for revision, break out of the loop at the end rather than looping forever. This prevents the server going into an infinite loop when the repository is behind the checkout, but the behaviour is not correct (it is an error rather than ignoring the file), so mark with an XXX for now. Some underlying OpenCVS functions are too fatal()-happy and will probably need to be changed in order to fix this properly. Problem reported by sthen. ok xsa ray --- usr.bin/cvs/rcs.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/usr.bin/cvs/rcs.c b/usr.bin/cvs/rcs.c index 3eac5b26018..4ea2d5912a4 100644 --- a/usr.bin/cvs/rcs.c +++ b/usr.bin/cvs/rcs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rcs.c,v 1.297 2010/07/23 21:46:05 ray Exp $ */ +/* $OpenBSD: rcs.c,v 1.298 2010/07/31 11:37:37 nicm Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. @@ -2783,6 +2783,13 @@ again: trdp = rcs_findrev(rfp, rdp->rd_next); if (trdp == NULL) fatal("failed to grab next revision"); + } else { + /* + * XXX Fail, although the caller does not always do the + * right thing (eg cvs diff when the tree is ahead of + * the repository). + */ + break; } if (rdp->rd_tlen == 0) { -- 2.20.1