nvi-15-search_word.patch (917B)
1 #! /bin/sh /usr/share/dpatch/dpatch-run 2 ## 15search_word.dpatch by Al Viro <viro@ZenIV.linux.org.uk> 3 ## 4 ## DP: Fix {^A} command. (End-of-word was not included in search 5 ## DP: regexp leading to false positives.) 6 7 @DPATCH@ 8 --- nvi-1.81.6.orig/vi/v_search.c 2007-11-18 11:41:42.000000000 -0500 9 +++ nvi-1.81.6/vi/v_search.c 2009-03-05 15:37:37.000000000 -0500 10 @@ -322,16 +322,17 @@ 11 v_searchw(SCR *sp, VICMD *vp) 12 { 13 size_t blen, len; 14 + size_t olen = STRLEN(VIP(sp)->keyw); 15 int rval; 16 CHAR_T *bp, *p; 17 18 - len = VIP(sp)->klen + RE_WSTART_LEN + RE_WSTOP_LEN; 19 + len = olen + RE_WSTART_LEN + RE_WSTOP_LEN; 20 GET_SPACE_RETW(sp, bp, blen, len); 21 MEMCPY(bp, RE_WSTART, RE_WSTART_LEN); 22 p = bp + RE_WSTART_LEN; 23 - MEMCPY(p, VIP(sp)->keyw, VIP(sp)->klen); 24 - p += VIP(sp)->klen; 25 + MEMCPY(p, VIP(sp)->keyw, olen); 26 + p += olen; 27 MEMCPY(p, RE_WSTOP, RE_WSTOP_LEN); 28 29 rval = v_search(sp, vp, bp, len, SEARCH_SET, FORWARD);