Module Name: src
Committed By: riz
Date: Sun Nov 21 22:03:00 UTC 2010
Modified Files:
src/dist/nvi/vi [netbsd-5]: v_search.c
Log Message:
Pull up following revision(s) (requested by christos in ticket #1467):
dist/nvi/vi/v_search.c: revision 1.3
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_wo
rd.dpatch
To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2.6.1 -r1.1.1.2.6.2 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.1.1.2.6.1 src/dist/nvi/vi/v_search.c:1.1.1.2.6.2
--- src/dist/nvi/vi/v_search.c:1.1.1.2.6.1 Tue Jan 20 02:41:13 2009
+++ src/dist/nvi/vi/v_search.c Sun Nov 21 22:03:00 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: v_search.c,v 1.1.1.2.6.1 2009/01/20 02:41:13 snj Exp $ */
+/* $NetBSD: v_search.c,v 1.1.1.2.6.2 2010/11/21 22:03:00 riz 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);