Re: Reminder of bug in vi and nvi including tested diff

2023-09-07 Thread Raf Czlonka
On Thu, Sep 07, 2023 at 01:10:17PM BST, Walter Alejandro Iglesias wrote:
> 
> I didn't know that, thanks.  I'd like to send the patch to the
> maintainer of this version too, but after downloading a snapshot a
> README.1st in the tarball says:
> 
> Please do not contact the original authors about bugs you
> find in this version. Contact skimo...@kotnet.org instead.
> [...] 
> New versions will be made available on 
> http://www.kotnet.org/~skimo/nvi
> [...]
> 
> Sven Verdoolaege
> 
> 
> It's not clear who I should contact to, the http link is broken so
> probably the email address is also broken.
> 
> And the info the tarball about how to build it is also incomplete.
> 
> Perhaps this project is a bit abandoned?

Hi Walter,

No worries!

The way I read the above is Sven Verdoolaege (skimo) saying:

Do not contact Keith Bostic et al., contact me instead.

Either way, the last time I contacted Sven, which was some years
ago mind you, I had first used the nvi's Git repository owner's
email address. You might also try the email address from the last
two commits (Signed-Off field) where the replies came from.

Regards,

Raf



Re: Reminder of bug in vi and nvi including tested diff

2023-09-07 Thread Walter Alejandro Iglesias
Hi Raf,

On Thu, Sep 07, 2023 at 12:08:00PM +0100, Raf Czlonka wrote:
> On Thu, Sep 07, 2023 at 08:04:43AM BST, Walter Alejandro Iglesias wrote:
> > Dear OpenBSD developers,
> > 
> > On Aug 2 I reported this bug:
> > 
> >   https://marc.info/?l=openbsd-bugs=169100763926909=2
> > 
> > After fiddling around I found a solution that works for both vi base and
> > nvi from ports:
> > 
> >   https://marc.info/?l=openbsd-bugs=16926218514=2
> > 
> > Since nobody answered me in bugs@ I sent a message to ports@ and Cc:
> > Anthony J. Bentley who told me to contact Zhihao Yuan, nvi developer
> > upstream.  I don't use github, I don't have a github account, luckily
> > after searching the web I found an email address of Zhihao.  He
> > understood the issue and answered me with what seems to be a more
> > consistent patch:
> > 
> >   https://marc.info/?l=openbsd-bugs=169277277928008=2
> > 
> > Which, needless to say, also works for both. vi on base and nvi on
> > ports.  Below I paste a cvs version of Zhihao's patch to use it with vi
> > on base.
> > 
> > So it only rests some OpenBSD developer here to take look.  It's not
> > going to take up much of your time, everything has already been chewed
> > up :-).
> 
> Hi Walter,
> 
> This isn't related to the bug per se but it might be useful bit of
> information regardless.
> 
> The nvi port is actually nvi2[0], which is based on the original
> (read Keith Bostic's) nvi, where, in turn, the base vi(1) comes
> from.
> 
> The original nvi is still maintained[1] by Sven Verdoolaege[2] so
> you might want to give him a shout, too.
> 
> [0] https://github.com/lichray/nvi2
> [1] https://repo.or.cz/nvi.git
> [2] 
> https://sites.google.com/a/bostic.com/keithbostic/the-berkeley-vi-editor-home-page

I didn't know that, thanks.  I'd like to send the patch to the
maintainer of this version too, but after downloading a snapshot a
README.1st in the tarball says:

Please do not contact the original authors about bugs you
find in this version. Contact skimo...@kotnet.org instead.
[...] 
New versions will be made available on 
http://www.kotnet.org/~skimo/nvi
[...]

Sven Verdoolaege


It's not clear who I should contact to, the http link is broken so
probably the email address is also broken.

And the info the tarball about how to build it is also incomplete.

Perhaps this project is a bit abandoned?


> 
> Regards,
> 
> Raf


-- 
Walter



Re: Reminder of bug in vi and nvi including tested diff

2023-09-07 Thread Tobias Heider
On Thu, Sep 07, 2023 at 09:04:43AM +0200, Walter Alejandro Iglesias wrote:
> Dear OpenBSD developers,
> 
> On Aug 2 I reported this bug:
> 
>   https://marc.info/?l=openbsd-bugs=169100763926909=2
> 
> After fiddling around I found a solution that works for both vi base and
> nvi from ports:
> 
>   https://marc.info/?l=openbsd-bugs=16926218514=2
> 
> Since nobody answered me in bugs@ I sent a message to ports@ and Cc:
> Anthony J. Bentley who told me to contact Zhihao Yuan, nvi developer
> upstream.  I don't use github, I don't have a github account, luckily
> after searching the web I found an email address of Zhihao.  He
> understood the issue and answered me with what seems to be a more
> consistent patch:
> 
>   https://marc.info/?l=openbsd-bugs=169277277928008=2
> 
> Which, needless to say, also works for both. vi on base and nvi on
> ports.  Below I paste a cvs version of Zhihao's patch to use it with vi
> on base.
> 
> So it only rests some OpenBSD developer here to take look.  It's not
> going to take up much of your time, everything has already been chewed
> up :-).

Thanks for the detailed bug report and fix!
Committed.

> 
> 
> Zhihao's diff translated to cvs:
> 
> Index: vi/v_paragraph.c
> ===
> RCS file: /cvs/src/usr.bin/vi/vi/v_paragraph.c,v
> retrieving revision 1.9
> diff -u -p -r1.9 v_paragraph.c
> --- vi/v_paragraph.c  18 Apr 2017 01:45:35 -  1.9
> +++ vi/v_paragraph.c  23 Aug 2023 10:18:39 -
> @@ -41,15 +41,20 @@
>   if (p[0] == '\014') {   \
>   if (!--cnt) \
>   goto found; \
> + if (pstate == P_INTEXT && !--cnt)   \
> + goto found; \
>   continue;   \
>   }   \
>   if (p[0] != '.' || len < 2) \
>   continue;   \
>   for (lp = VIP(sp)->ps; *lp != '\0'; lp += 2)\
>   if (lp[0] == p[1] &&\
> - ((lp[1] == ' ' && len == 2) || lp[1] == p[2]) &&\
> - !--cnt) \
> - goto found; \
> + (lp[1] == ' ' && len == 2 || lp[1] == p[2])) {  \
> + if (!--cnt) \
> + goto found; \
> + if (pstate == P_INTEXT && !--cnt)   \
> + goto found; \
> + }   \
>  }
>  
>  /*
> 
> 
> -- 
> Walter
> 



Re: Reminder of bug in vi and nvi including tested diff

2023-09-07 Thread Raf Czlonka
On Thu, Sep 07, 2023 at 08:04:43AM BST, Walter Alejandro Iglesias wrote:
> Dear OpenBSD developers,
> 
> On Aug 2 I reported this bug:
> 
>   https://marc.info/?l=openbsd-bugs=169100763926909=2
> 
> After fiddling around I found a solution that works for both vi base and
> nvi from ports:
> 
>   https://marc.info/?l=openbsd-bugs=16926218514=2
> 
> Since nobody answered me in bugs@ I sent a message to ports@ and Cc:
> Anthony J. Bentley who told me to contact Zhihao Yuan, nvi developer
> upstream.  I don't use github, I don't have a github account, luckily
> after searching the web I found an email address of Zhihao.  He
> understood the issue and answered me with what seems to be a more
> consistent patch:
> 
>   https://marc.info/?l=openbsd-bugs=169277277928008=2
> 
> Which, needless to say, also works for both. vi on base and nvi on
> ports.  Below I paste a cvs version of Zhihao's patch to use it with vi
> on base.
> 
> So it only rests some OpenBSD developer here to take look.  It's not
> going to take up much of your time, everything has already been chewed
> up :-).

Hi Walter,

This isn't related to the bug per se but it might be useful bit of
information regardless.

The nvi port is actually nvi2[0], which is based on the original
(read Keith Bostic's) nvi, where, in turn, the base vi(1) comes
from.

The original nvi is still maintained[1] by Sven Verdoolaege[2] so
you might want to give him a shout, too.

[0] https://github.com/lichray/nvi2
[1] https://repo.or.cz/nvi.git
[2] 
https://sites.google.com/a/bostic.com/keithbostic/the-berkeley-vi-editor-home-page

Regards,

Raf