CVS commit: src/external/bsd/nvi/dist/common

2023-02-13 Thread David H. Gutteridge
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.



CVS commit: src/external/bsd/nvi/dist/common

2023-02-13 Thread David H. Gutteridge
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.

Modified files:

Index: src/external/bsd/nvi/dist/common/search.c
diff -u src/external/bsd/nvi/dist/common/search.c:1.4 src/external/bsd/nvi/dist/common/search.c:1.5
--- src/external/bsd/nvi/dist/common/search.c:1.4	Wed Nov 22 16:17:30 2017
+++ src/external/bsd/nvi/dist/common/search.c	Mon Feb 13 23:08:43 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: search.c,v 1.4 2017/11/22 16:17:30 rin Exp $ */
+/*	$NetBSD: search.c,v 1.5 2023/02/13 23:08:43 gutteridge Exp $ */
 /*-
  * Copyright (c) 1992, 1993, 1994
  *	The Regents of the University of California.  All rights reserved.
@@ -16,7 +16,7 @@
 static const char sccsid[] = "Id: search.c,v 10.31 2001/06/25 15:19:12 skimo Exp  (Berkeley) Date: 2001/06/25 15:19:12 ";
 #endif /* not lint */
 #else
-__RCSID("$NetBSD: search.c,v 1.4 2017/11/22 16:17:30 rin Exp $");
+__RCSID("$NetBSD: search.c,v 1.5 2023/02/13 23:08:43 gutteridge Exp $");
 #endif
 
 #include 
@@ -110,9 +110,14 @@ prev:			if (sp->re == NULL) {
 	++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)



Re: CVS commit: src/external/bsd/nvi/dist/common

2018-06-16 Thread Kamil Rytarowski
On 16.06.2018 22:39, Christos Zoulas wrote:
> In article <20180616185452.afd29f...@cvs.netbsd.org>,
> Kamil Rytarowski  wrote:
>> -=-=-=-=-=-
>>
>> Module Name: src
>> Committed By:kamil
>> Date:Sat Jun 16 18:54:52 UTC 2018
>>
>> Modified Files:
>>  src/external/bsd/nvi/dist/common: log.c
>>
>> Log Message:
>> Do not cause Undefined Behavior in vi(1)
>>
>> Replace unportable manual calculation of alignof() that causes UB, with
>> a GCC extension __alignof__.
> 
> Isn't that offsetof() instead?
> 
> christos
> 

Fixed!



signature.asc
Description: OpenPGP digital signature


Re: CVS commit: src/external/bsd/nvi/dist/common

2018-06-16 Thread Christos Zoulas
In article <20180616185452.afd29f...@cvs.netbsd.org>,
Kamil Rytarowski  wrote:
>-=-=-=-=-=-
>
>Module Name:   src
>Committed By:  kamil
>Date:  Sat Jun 16 18:54:52 UTC 2018
>
>Modified Files:
>   src/external/bsd/nvi/dist/common: log.c
>
>Log Message:
>Do not cause Undefined Behavior in vi(1)
>
>Replace unportable manual calculation of alignof() that causes UB, with
>a GCC extension __alignof__.

Isn't that offsetof() instead?

christos