Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/dist/nvi/vi PR/44006: Ralph G: vi: CTRL-A does not handle en...



details:   https://anonhg.NetBSD.org/src/rev/10344d72822d
branches:  trunk
changeset: 758251:10344d72822d
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Oct 28 18:12:47 2010 +0000

description:
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

diffstat:

 dist/nvi/vi/v_search.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (29 lines):

diff -r 01ce0ea102b1 -r 10344d72822d dist/nvi/vi/v_search.c
--- a/dist/nvi/vi/v_search.c    Thu Oct 28 18:03:11 2010 +0000
+++ b/dist/nvi/vi/v_search.c    Thu Oct 28 18:12:47 2010 +0000
@@ -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);



Home | Main Index | Thread Index | Old Index