NetBSD Problem Report #57106

From www@netbsd.org  Sat Dec 10 23:05:09 2022
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 05FAB1A921F
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 10 Dec 2022 23:05:09 +0000 (UTC)
Message-Id: <20221210230438.15AE01A9239@mollari.NetBSD.org>
Date: Sat, 10 Dec 2022 23:04:38 +0000 (UTC)
From: jbgg@disroot.org
Reply-To: jbgg@disroot.org
To: gnats-bugs@NetBSD.org
Subject: /usr/bin/vi doesn't handle correctly backslash in ex_line
X-Send-Pr-Version: www-1.0

>Number:         57106
>Category:       bin
>Synopsis:       /usr/bin/vi doesn't handle correctly backslash in ex_line
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    gutteridge
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Dec 10 23:10:00 +0000 2022
>Closed-Date:    Fri Feb 24 14:54:45 +0000 2023
>Last-Modified:  Fri Feb 24 14:54:45 +0000 2023
>Originator:     Bosco G. G.
>Release:        NetBSD 7.3
>Organization:
>Environment:
NetBSD localhost 9.3 NetBSD 9.3 (GENERIC) #0: Thu Aug  4 15:30:37 UTC 2022  mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/amd64/compile/GENERIC amd64
>Description:
The editor vi doesn't handle correctly backslash when a searching.
>How-To-Repeat:
$ printf '%s\n' '/' '\' > test.txt

Opening test.txt with vi and searching with
/\\/
doesn't catch the backslash but the slash.
>Fix:

>Release-Note:

>Audit-Trail:
From: "Bosco G. G." <jbgg@disroot.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: bin/57106
Date: Sun, 11 Dec 2022 00:12:43 +0100

 Index: src/external/bsd/nvi/dist/common/search.c
 ===================================================================
 RCS file: /cvsroot/src/external/bsd/nvi/dist/common/search.c,v
 retrieving revision 1.4
 diff -u -r1.4 search.c
 --- src/external/bsd/nvi/dist/common/search.c	22 Nov 2017 16:17:30 -0000	1.4
 +++ src/external/bsd/nvi/dist/common/search.c	10 Dec 2022 22:46:31 -0000
 @@ -110,9 +110,14 @@
  					++p;
  				break;
  			}
 -			if (plen > 1 && p[0] == '\\' && p[1] == delim) {
 -				++p;
 -				--plen;
 +			if (plen > 1 && p[0] == '\\') {
 +				if(p[1] == delim) {
 +					++p;
 +					--plen;
 +				} else if(p[1] == '\\') {
 +					*t++ = *p++;
 +					--plen;
 +				}
  			}
  		}
  		if (epp != NULL)

Responsible-Changed-From-To: bin-bug-people->gutteridge
Responsible-Changed-By: gutteridge@NetBSD.org
Responsible-Changed-When: Mon, 13 Feb 2023 23:04:54 +0000
Responsible-Changed-Why:
I'll handle this.

From: "David H. Gutteridge" <gutteridge@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/57106 CVS commit: src/external/bsd/nvi/dist/common
Date: Mon, 13 Feb 2023 23:08:43 +0000

 Module Name:	src
 Committed By:	gutteridge
 Date:		Mon Feb 13 23:08:43 UTC 2023

 Modified Files:
 	src/external/bsd/nvi/dist/common: search.c

 Log Message:
 search.c: correctly handle escaped backslashes

 Addresses PR bin/57106 from Bosco G. G., who supplied the patch.
 (This was also committed in the nvi2 sources:
 https://github.com/lichray/nvi2/commit/e7054267a371d5caa81edb218f5c8388e11b5197)


 To generate a diff of this commit:
 cvs rdiff -u -r1.4 -r1.5 src/external/bsd/nvi/dist/common/search.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->needs-pullups
State-Changed-By: gutteridge@NetBSD.org
State-Changed-When: Mon, 13 Feb 2023 23:13:18 +0000
State-Changed-Why:
Needs pullup requests submitted.

State-Changed-From-To: needs-pullups->pending-pullups
State-Changed-By: gutteridge@NetBSD.org
State-Changed-When: Sun, 19 Feb 2023 02:24:07 +0000
State-Changed-Why:
Pullup tickets netbsd-10 #102, netbsd-9 #1606.

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/57106 CVS commit: [netbsd-10] src/external/bsd/nvi/dist/common
Date: Fri, 24 Feb 2023 13:05:24 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Fri Feb 24 13:05:24 UTC 2023

 Modified Files:
 	src/external/bsd/nvi/dist/common [netbsd-10]: search.c

 Log Message:
 Pull up following revision(s) (requested by gutteridge in ticket #102):

 	external/bsd/nvi/dist/common/search.c: revision 1.5

 search.c: correctly handle escaped backslashes

 Addresses PR bin/57106 from Bosco G. G., who supplied the patch.

 (This was also committed in the nvi2 sources:
 https://github.com/lichray/nvi2/commit/e7054267a371d5caa81edb218f5c8388e11b5197)


 To generate a diff of this commit:
 cvs rdiff -u -r1.4 -r1.4.14.1 src/external/bsd/nvi/dist/common/search.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/57106 CVS commit: [netbsd-9] src/external/bsd/nvi/dist/common
Date: Fri, 24 Feb 2023 13:06:48 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Fri Feb 24 13:06:48 UTC 2023

 Modified Files:
 	src/external/bsd/nvi/dist/common [netbsd-9]: search.c

 Log Message:
 Pull up following revision(s) (requested by gutteridge in ticket #1606):

 	external/bsd/nvi/dist/common/search.c: revision 1.5

 search.c: correctly handle escaped backslashes

 Addresses PR bin/57106 from Bosco G. G., who supplied the patch.

 (This was also committed in the nvi2 sources:
 https://github.com/lichray/nvi2/commit/e7054267a371d5caa81edb218f5c8388e11b5197)


 To generate a diff of this commit:
 cvs rdiff -u -r1.4 -r1.4.6.1 src/external/bsd/nvi/dist/common/search.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: pending-pullups->closed
State-Changed-By: gutteridge@NetBSD.org
State-Changed-When: Fri, 24 Feb 2023 14:54:45 +0000
State-Changed-Why:
Pullups to the 9 and 10 branches completed. Thanks for the PR!

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2023 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.