From 27155f7a1d4379301d235ed68ce8122166056427 Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 18 Mar 1999 09:31:26 +0000 Subject: [PATCH] Merge cvs-1.9.xx -> 1.10 changes onto mainline. The merge turned up a long-standing bug in local additions. I'm not quite sure it's right yet. (the code in question is dealing with diffs relative to "HEAD" and dead revisions). --- contrib/cvs/src/diff.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/contrib/cvs/src/diff.c b/contrib/cvs/src/diff.c index 66d155eba5c3..ff1c4ed504d6 100644 --- a/contrib/cvs/src/diff.c +++ b/contrib/cvs/src/diff.c @@ -434,16 +434,23 @@ diff_fileproc (callerdat, finfo) exists = 0; /* special handling for TAG_HEAD */ if (diff_rev1 && strcmp (diff_rev1, TAG_HEAD) == 0) - exists = (vers->vn_rcs != NULL && /* XXX ? */ - !RCS_isdead (vers->srcfile, vers->vn_rcs)); /*XXX*/ + { + char *head = + (vers->vn_rcs == NULL + ? NULL + : RCS_branch_head (vers->srcfile, vers->vn_rcs)); + exists = head != NULL; + if (head != NULL) + free (head); + } else { Vers_TS *xvers; xvers = Version_TS (finfo, NULL, diff_rev1, diff_date1, 1, 0); - exists = (vers->vn_rcs != NULL && - !RCS_isdead (vers->srcfile, vers->vn_rcs)); /*XXX*/ + exists = (xvers->vn_rcs != NULL && + !RCS_isdead (xvers->srcfile, xvers->vn_rcs)); /*XXX*/ freevers_ts (&xvers); } if (exists) @@ -816,7 +823,9 @@ diff_file_nodiff (finfo, vers, empty_file) { /* special handling for TAG_HEAD */ if (diff_rev1 && strcmp (diff_rev1, TAG_HEAD) == 0) - use_rev1 = xstrdup (vers->vn_rcs); + use_rev1 = ((vers->vn_rcs == NULL || vers->srcfile == NULL) + ? NULL + : RCS_branch_head (vers->srcfile, vers->vn_rcs)); else { xvers = Version_TS (finfo, NULL, diff_rev1, diff_date1, 1, 0); @@ -829,7 +838,9 @@ diff_file_nodiff (finfo, vers, empty_file) { /* special handling for TAG_HEAD */ if (diff_rev2 && strcmp (diff_rev2, TAG_HEAD) == 0) - use_rev2 = xstrdup (vers->vn_rcs); + use_rev2 = ((vers->vn_rcs == NULL || vers->srcfile == NULL) + ? NULL + : RCS_branch_head (vers->srcfile, vers->vn_rcs)); else { xvers = Version_TS (finfo, NULL, diff_rev2, diff_date2, 1, 0);