NetBSD Problem Report #59103

From www@netbsd.org  Tue Feb 25 09:30:35 2025
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)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
	 client-signature RSA-PSS (2048 bits) client-digest SHA256)
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 36F671A923D
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 25 Feb 2025 09:30:35 +0000 (UTC)
Message-Id: <20250225093034.10F0A1A923F@mollari.NetBSD.org>
Date: Tue, 25 Feb 2025 09:30:34 +0000 (UTC)
From: rvp@SDF.ORG
Reply-To: rvp@SDF.ORG
To: gnats-bugs@NetBSD.org
Subject: vi(1): search of non-ASCII chars. broken when `:set extended' is set
X-Send-Pr-Version: www-1.0

>Number:         59103
>Category:       bin
>Synopsis:       vi(1): search of non-ASCII chars. broken when `:set extended' is set
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          needs-pullups
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Feb 25 09:35:00 +0000 2025
>Closed-Date:    
>Last-Modified:  Wed Mar 26 08:10:01 +0000 2025
>Originator:     RVP
>Release:        NetBSD/amd64 10.99.12
>Organization:
>Environment:
NetBSD/amd64 10.99.12
>Description:
When ERE searches are set using `:set extended' in vi(1), searching for
non-ASCII chars. fails to find them in the text.
>How-To-Repeat:
$ LANG=C printf '\xA1 a b c \xA1 c d e \xff\n' > ere.txt
$ LANG=C vi ere.txt
:set extended                   # ERE searches
/<Ctrl-X>A1                     # search for \xA1
:q
$
>Fix:
diff -urN src/external/bsd/nvi.orig/dist/regex/regcomp.c src/external/bsd/nvi/dist/regex/regcomp.c
--- src/external/bsd/nvi.orig/dist/regex/regcomp.c	2021-05-17 04:01:57.000000000 +0000
+++ src/external/bsd/nvi/dist/regex/regcomp.c	2025-02-25 08:56:21.645965752 +0000
@@ -307,7 +307,7 @@

          			/* character this ERE should end at */
 {
-	char c;
+	unsigned char c;
 	sopno prevback = 0;
 	sopno prevfwd = 0;
 	sopno conc;
@@ -356,7 +356,7 @@
 static void
 p_ere_exp(struct parse *p, size_t reclimit)
 {
-	char c;
+	unsigned char c;
 	sopno pos;
 	int count;
 	int count2;

>Release-Note:

>Audit-Trail:
From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/59103 CVS commit: src/external/bsd/nvi/dist/regex
Date: Thu, 20 Mar 2025 14:39:17 -0400

 Module Name:	src
 Committed By:	christos
 Date:		Thu Mar 20 18:39:17 UTC 2025

 Modified Files:
 	src/external/bsd/nvi/dist/regex: regcomp.c

 Log Message:
 PR/59103: RVP: Search of non-ASCII chars. broken when `:set extended' is set


 To generate a diff of this commit:
 cvs rdiff -u -r1.8 -r1.9 src/external/bsd/nvi/dist/regex/regcomp.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: riastradh@NetBSD.org
State-Changed-When: Tue, 25 Mar 2025 19:57:08 +0000
State-Changed-Why:
Guessing this is fixed?  (Not sure we have any automatic tests for vi,
though...)


From: RVP <rvp@SDF.ORG>
To: gnats-bugs@netbsd.org
Cc: riastradh@NetBSD.org
Subject: Re: bin/59103 (vi(1): search of non-ASCII chars. broken when `:set
 extended' is set)
Date: Wed, 26 Mar 2025 08:06:14 +0000 (UTC)

 On Tue, 25 Mar 2025, riastradh@NetBSD.org wrote:

 > Guessing this is fixed?
 >

 Yup. Please pull-up to 10.x and 9.x too as the fix is very simple.

 Thx,

 -RVP

>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-2025 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.