From e6f3651c0396c2eb8f643c737d78da149db3b25d Mon Sep 17 00:00:00 2001 From: jdp Date: Sun, 29 Oct 2000 03:56:49 +0000 Subject: Fix a bug that shows up when checking out files by date with the "-D date" command line option. There is code in the original to handle a special case. If the date search finds revision 1.1 it is supposed to check whether revision 1.1.1.1 has the same date stamp, which would indicate that the file was originally brought in with "cvs import". In that case it is supposed to return the vendor branch version 1.1.1.1. However, there is a bug in the code. It actually compares the date of revision 1.1 for equality with the date given on the command line -- clearly wrong. This commit fixes the coding bug. There is an additional bug which is _not_ fixed in this commit. The date comparison should not be a strict equality test. It should allow a fudge factor of, say, 2-3 seconds. Old versions of CVS created the two revisions with two separate invocations of the RCS "ci" command. We have many old files in the tree in which the dates of revisions 1.1 and 1.1.1.1 differ by 1 second. Approved by: peter --- contrib/cvs/src/rcs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'contrib/cvs/src') diff --git a/contrib/cvs/src/rcs.c b/contrib/cvs/src/rcs.c index 7f2094d8..1e9edce 100644 --- a/contrib/cvs/src/rcs.c +++ b/contrib/cvs/src/rcs.c @@ -2900,8 +2900,10 @@ RCS_getdate (rcs, date, force_tag_match) p = findnode (rcs->versions, "1.1.1.1"); if (p) { + char *date_1_1 = vers->date; + vers = (RCSVers *) p->data; - if (RCS_datecmp (vers->date, date) != 0) + if (RCS_datecmp (vers->date, date_1_1) != 0) return xstrdup ("1.1"); } } -- cgit v1.1