From: Kenichi Handa Date: Sat, 20 May 2000 00:05:02 +0000 (+0000) Subject: (wordify): Use FETCH_STRING_CHAR_ADVANCE X-Git-Tag: emacs-pretest-21.0.90~3868 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=eb99a8dd64596a998e474dcf7ba85f5387ef0439;p=emacs.git (wordify): Use FETCH_STRING_CHAR_ADVANCE unconditionally. (Freplace_match): Use FETCH_STRING_CHAR_ADVANCE and FETCH_STRING_CHAR_ADVANCE_NO_CHECK appropriately. --- diff --git a/src/search.c b/src/search.c index b80c1411cf6..ce076a18c92 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); }