Module Name:    src
Committed By:   christos
Date:           Thu Oct 28 18:12:47 UTC 2010

Modified Files:
        src/dist/nvi/vi: v_search.c

Log Message:
PR/44006: Ralph G: vi: CTRL-A does not handle end-of-word correctly
End-of-word was not included in search regexp leading to false positives.
http://patches.ubuntu.com/by-release/extracted/debian/n/nvi/1.81.6-7/15search_word.dpatch


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/dist/nvi/vi/v_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/dist/nvi/vi/v_search.c
diff -u src/dist/nvi/vi/v_search.c:1.2 src/dist/nvi/vi/v_search.c:1.3
--- src/dist/nvi/vi/v_search.c:1.2	Fri Dec  5 17:51:43 2008
+++ src/dist/nvi/vi/v_search.c	Thu Oct 28 14:12:47 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: v_search.c,v 1.2 2008/12/05 22:51:43 christos Exp $ */
+/*	$NetBSD: v_search.c,v 1.3 2010/10/28 18:12:47 christos Exp $ */
 
 /*-
  * Copyright (c) 1992, 1993, 1994
@@ -324,15 +324,16 @@
 v_searchw(SCR *sp, VICMD *vp)
 {
 	size_t blen, len;
+	size_t olen = STRLEN(VIP(sp)->keyw);
 	int rval;
 	CHAR_T *bp, *p;
 
-	len = VIP(sp)->klen + RE_WSTART_LEN + RE_WSTOP_LEN;
+	len = olen + RE_WSTART_LEN + RE_WSTOP_LEN;
 	GET_SPACE_RETW(sp, bp, blen, len);
 	MEMCPY(bp, RE_WSTART, RE_WSTART_LEN); 
 	p = bp + RE_WSTART_LEN;
-	MEMCPY(p, VIP(sp)->keyw, VIP(sp)->klen);
-	p += VIP(sp)->klen;
+	MEMCPY(p, VIP(sp)->keyw, olen);
+	p += olen;
 	MEMCPY(p, RE_WSTOP, RE_WSTOP_LEN); 
 
 	rval = v_search(sp, vp, bp, len, SEARCH_SET, FORWARD);

Reply via email to