From 9009488db92c45baee0271b52d871e6a42b320ff Mon Sep 17 00:00:00 2001 From: skimo Date: Tue, 11 Sep 2001 20:52:45 +0000 Subject: [PATCH] (Hopefully) clean up RE_WST{ART,OP} mess. Makes ctrl-A work again (Problem reported by Arfst Ludwig ) --- common/screen.h | 6 +++--- ex/ex_subst.c | 14 +++++++------- vi/v_search.c | 6 +++--- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/common/screen.h b/common/screen.h index 5fb5fcf6..dc70c50d 100644 --- a/common/screen.h +++ b/common/screen.h @@ -6,7 +6,7 @@ * * See the LICENSE file for redistribution information. * - * $Id: screen.h,v 10.47 2001/08/29 12:25:13 skimo Exp $ (Berkeley) $Date: 2001/08/29 12:25:13 $ + * $Id: screen.h,v 10.48 2001/09/11 20:52:45 skimo Exp $ (Berkeley) $Date: 2001/09/11 20:52:45 $ */ /* @@ -168,8 +168,8 @@ struct _scr { /* Ex/vi: re_compile flags. */ #define RE_WSTART L("[[:<:]]") /* Ex/vi: not-in-word search pattern. */ #define RE_WSTOP L("[[:>:]]") -#define RE_WSTART_LEN (sizeof(RE_WSTART)/sizeof(CHAR_T)) -#define RE_WSTOP_LEN (sizeof(RE_WSTOP)/sizeof(CHAR_T)) +#define RE_WSTART_LEN (sizeof(RE_WSTART)/sizeof(CHAR_T)-1) +#define RE_WSTOP_LEN (sizeof(RE_WSTOP)/sizeof(CHAR_T)-1) /* Ex/vi: flags to search routines. */ #define SEARCH_CSCOPE 0x000001 /* Search for a cscope pattern. */ #define SEARCH_CSEARCH 0x000002 /* Compile search replacement. */ diff --git a/ex/ex_subst.c b/ex/ex_subst.c index 350eb7da..bca994e4 100644 --- a/ex/ex_subst.c +++ b/ex/ex_subst.c @@ -10,7 +10,7 @@ #include "config.h" #ifndef lint -static const char sccsid[] = "$Id: ex_subst.c,v 10.48 2001/06/25 15:19:20 skimo Exp $ (Berkeley) $Date: 2001/06/25 15:19:20 $"; +static const char sccsid[] = "$Id: ex_subst.c,v 10.49 2001/09/11 20:52:45 skimo Exp $ (Berkeley) $Date: 2001/09/11 20:52:45 $"; #endif /* not lint */ #include @@ -1043,11 +1043,11 @@ re_conv(SCR *sp, CHAR_T **ptrnp, size_t *plenp, int *replacedp) switch (*++p) { case '<': magic = 1; - needlen += RE_WSTART_LEN; + needlen += RE_WSTART_LEN + 1; break; case '>': magic = 1; - needlen += RE_WSTOP_LEN; + needlen += RE_WSTOP_LEN + 1; break; case '~': if (!O_ISSET(sp, O_MAGIC)) { @@ -1105,13 +1105,13 @@ re_conv(SCR *sp, CHAR_T **ptrnp, size_t *plenp, int *replacedp) switch (*++p) { case '<': MEMCPY(t, - RE_WSTART, RE_WSTART_LEN - 1); - t += RE_WSTART_LEN - 1; + RE_WSTART, RE_WSTART_LEN); + t += RE_WSTART_LEN; break; case '>': MEMCPY(t, - RE_WSTOP, RE_WSTOP_LEN - 1); - t += RE_WSTOP_LEN - 1; + RE_WSTOP, RE_WSTOP_LEN); + t += RE_WSTOP_LEN; break; case '~': if (O_ISSET(sp, O_MAGIC)) diff --git a/vi/v_search.c b/vi/v_search.c index e595e05c..8318d83f 100644 --- a/vi/v_search.c +++ b/vi/v_search.c @@ -10,7 +10,7 @@ #include "config.h" #ifndef lint -static const char sccsid[] = "$Id: v_search.c,v 10.29 2001/06/25 15:19:35 skimo Exp $ (Berkeley) $Date: 2001/06/25 15:19:35 $"; +static const char sccsid[] = "$Id: v_search.c,v 10.30 2001/09/11 20:52:46 skimo Exp $ (Berkeley) $Date: 2001/09/11 20:52:46 $"; #endif /* not lint */ #include @@ -328,10 +328,10 @@ v_searchw(SCR *sp, VICMD *vp) len = VIP(sp)->klen + RE_WSTART_LEN + RE_WSTOP_LEN; GET_SPACE_RETW(sp, bp, blen, len); MEMCPY(bp, RE_WSTART, RE_WSTART_LEN); - p = bp + sizeof(RE_WSTART)/sizeof(CHAR_T) - 1; + p = bp + RE_WSTART_LEN; MEMCPY(p, VIP(sp)->keyw, VIP(sp)->klen); p += VIP(sp)->klen; - MEMCPY(bp, RE_WSTOP, RE_WSTOP_LEN); + MEMCPY(p, RE_WSTOP, RE_WSTOP_LEN); rval = v_search(sp, vp, bp, len, SEARCH_SET, FORWARD); -- 2.11.4.GIT