From eb99a8dd64596a998e474dcf7ba85f5387ef0439 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Sat, 20 May 2000 00:05:02 +0000 Subject: [PATCH] (wordify): Use FETCH_STRING_CHAR_ADVANCE unconditionally. (Freplace_match): Use FETCH_STRING_CHAR_ADVANCE and FETCH_STRING_CHAR_ADVANCE_NO_CHECK appropriately. --- src/search.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/src/search.c b/src/search.c index b80c1411cf..ce076a18c9 100644 --- a/src/search.c +++ b/src/search.c @@ -1959,10 +1959,7 @@ wordify (string) { int c; - if (STRING_MULTIBYTE (string)) - FETCH_STRING_CHAR_ADVANCE (c, string, i, i_byte); - else - c = XSTRING (string)->data[i++]; + FETCH_STRING_CHAR_ADVANCE (c, string, i, i_byte); if (SYNTAX (c) != Sword) { @@ -1997,13 +1994,7 @@ wordify (string) int c; int i_byte_orig = i_byte; - if (STRING_MULTIBYTE (string)) - FETCH_STRING_CHAR_ADVANCE (c, string, i, i_byte); - else - { - c = XSTRING (string)->data[i++]; - i_byte++; - } + FETCH_STRING_CHAR_ADVANCE (c, string, i, i_byte); if (SYNTAX (c) == Sword) { @@ -2349,6 +2340,7 @@ since only regular expressions have distinguished subexpressions.") if (c == '\\') { FETCH_STRING_CHAR_ADVANCE (c, newtext, pos, pos_byte); + if (c == '&') { substart = search_regs.start[sub]; @@ -2460,7 +2452,7 @@ since only regular expressions have distinguished subexpressions.") if (str_multibyte) { - FETCH_STRING_CHAR_ADVANCE (c, newtext, pos, pos_byte); + FETCH_STRING_CHAR_ADVANCE_NO_CHECK (c, newtext, pos, pos_byte); if (!buf_multibyte) c = multibyte_char_to_unibyte (c, rev_tbl); } @@ -2480,7 +2472,8 @@ since only regular expressions have distinguished subexpressions.") { if (str_multibyte) { - FETCH_STRING_CHAR_ADVANCE (c, newtext, pos, pos_byte); + FETCH_STRING_CHAR_ADVANCE_NO_CHECK (c, newtext, + pos, pos_byte); if (!buf_multibyte && !SINGLE_BYTE_CHAR_P (c)) c = multibyte_char_to_unibyte (c, rev_tbl); } -- 2.39.2