> -----Original Message-----
> From: Hiltjo Posthuma <[email protected]>
> Sent: 21 July 2020 10:56
> > Index: re_search.c
> > ===================================================================
> > RCS file: /var/cvs/src/usr.bin/mg/re_search.c,v
> > retrieving revision 1.34
> > diff -u -p -r1.34 re_search.c
> > --- re_search.c     9 Jul 2020 10:42:24 -0000       1.34
> > +++ re_search.c     13 Jul 2020 16:17:07 -0000
> > @@ -308,7 +308,7 @@ re_doreplace(RSIZE plen, char *st)
> >  static int
> >  re_forwsrch(void)
> >  {
> > -   int      tbo, tdotline, error;
> > +   int              re_flags, tbo, tdotline, error;
> >     struct line     *clp;
> >
> >     clp = curwp->w_dotp;
> > @@ -318,9 +318,10 @@ re_forwsrch(void)
> >     if (tbo == clp->l_used)
> >             /*
> >              * Don't start matching past end of line -- must move to
> > -            * beginning of next line, unless at end of file.
> > +            * beginning of next line, unless line is empty or at
> > +            * end of file.
> >              */
> 
> I think the below line should stay the same, else forward searching on
> empty lines does not work:
> 
> > -           if (clp != curbp->b_headp) {
> > +           if (clp != curbp->b_headp && llength(clp) != 0) {
> 
> 

Hiltjo,

Thanks very much for your review.  What you point out above is certainly
true, but
then it is consistent with the current behaviour when searching for the
beginning-of-line ('^') anchor and the point at the beginning of a
non-empty line. In that case, the point does not move.

-mark
--
Mark Willson
[email protected]
https://hydrus.org.uk

Reply via email to