On Wed, 22 Jun 2016 12:21:56 +0200, Joris Vink wrote:

> This diff below fixes a serious issue in opencvs when
> checking out revisions from a branch.
> 
> Properly perform a revision lookup so update -r actually
> works again, as a bonus throw a more correct error when
> the revision could not be found.
> 
> .joris
> 
> Index: rcs.c
> ===================================================================
> RCS file: /cvs/src/usr.bin/cvs/rcs.c,v
> retrieving revision 1.313
> diff -u -p -r1.313 rcs.c
> --- rcs.c     5 Nov 2015 09:48:21 -0000       1.313
> +++ rcs.c     22 Jun 2016 09:52:04 -0000
> @@ -1796,17 +1796,13 @@ rcs_rev_getlines(RCSFILE *rfp, RCSNUM *f
>  
>  again:
>       for (;;) {
> +             if (rdp == NULL)
> +                     break;

Wouldn't this be easier to read as:

        while (rdp != NULL) {

> +
>               if (rdp->rd_next->rn_len != 0) {
>                       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) {

Reply via email to