aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa2000-05-20 00:05:02 +0000
committerKenichi Handa2000-05-20 00:05:02 +0000
commiteb99a8dd64596a998e474dcf7ba85f5387ef0439 (patch)
treea93c3f90c18bf328f153233aa2dae1963100297b /src
parenta4a37e652d5717aa8f13e83101f43ef381696532 (diff)
downloademacs-eb99a8dd64596a998e474dcf7ba85f5387ef0439.tar.gz
emacs-eb99a8dd64596a998e474dcf7ba85f5387ef0439.zip
(wordify): Use FETCH_STRING_CHAR_ADVANCE
unconditionally. (Freplace_match): Use FETCH_STRING_CHAR_ADVANCE and FETCH_STRING_CHAR_ADVANCE_NO_CHECK appropriately.
Diffstat (limited to 'src')
-rw-r--r--src/search.c19
1 files changed, 6 insertions, 13 deletions
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)
1959 { 1959 {
1960 int c; 1960 int c;
1961 1961
1962 if (STRING_MULTIBYTE (string)) 1962 FETCH_STRING_CHAR_ADVANCE (c, string, i, i_byte);
1963 FETCH_STRING_CHAR_ADVANCE (c, string, i, i_byte);
1964 else
1965 c = XSTRING (string)->data[i++];
1966 1963
1967 if (SYNTAX (c) != Sword) 1964 if (SYNTAX (c) != Sword)
1968 { 1965 {
@@ -1997,13 +1994,7 @@ wordify (string)
1997 int c; 1994 int c;
1998 int i_byte_orig = i_byte; 1995 int i_byte_orig = i_byte;
1999 1996
2000 if (STRING_MULTIBYTE (string)) 1997 FETCH_STRING_CHAR_ADVANCE (c, string, i, i_byte);
2001 FETCH_STRING_CHAR_ADVANCE (c, string, i, i_byte);
2002 else
2003 {
2004 c = XSTRING (string)->data[i++];
2005 i_byte++;
2006 }
2007 1998
2008 if (SYNTAX (c) == Sword) 1999 if (SYNTAX (c) == Sword)
2009 { 2000 {
@@ -2349,6 +2340,7 @@ since only regular expressions have distinguished subexpressions.")
2349 if (c == '\\') 2340 if (c == '\\')
2350 { 2341 {
2351 FETCH_STRING_CHAR_ADVANCE (c, newtext, pos, pos_byte); 2342 FETCH_STRING_CHAR_ADVANCE (c, newtext, pos, pos_byte);
2343
2352 if (c == '&') 2344 if (c == '&')
2353 { 2345 {
2354 substart = search_regs.start[sub]; 2346 substart = search_regs.start[sub];
@@ -2460,7 +2452,7 @@ since only regular expressions have distinguished subexpressions.")
2460 2452
2461 if (str_multibyte) 2453 if (str_multibyte)
2462 { 2454 {
2463 FETCH_STRING_CHAR_ADVANCE (c, newtext, pos, pos_byte); 2455 FETCH_STRING_CHAR_ADVANCE_NO_CHECK (c, newtext, pos, pos_byte);
2464 if (!buf_multibyte) 2456 if (!buf_multibyte)
2465 c = multibyte_char_to_unibyte (c, rev_tbl); 2457 c = multibyte_char_to_unibyte (c, rev_tbl);
2466 } 2458 }
@@ -2480,7 +2472,8 @@ since only regular expressions have distinguished subexpressions.")
2480 { 2472 {
2481 if (str_multibyte) 2473 if (str_multibyte)
2482 { 2474 {
2483 FETCH_STRING_CHAR_ADVANCE (c, newtext, pos, pos_byte); 2475 FETCH_STRING_CHAR_ADVANCE_NO_CHECK (c, newtext,
2476 pos, pos_byte);
2484 if (!buf_multibyte && !SINGLE_BYTE_CHAR_P (c)) 2477 if (!buf_multibyte && !SINGLE_BYTE_CHAR_P (c))
2485 c = multibyte_char_to_unibyte (c, rev_tbl); 2478 c = multibyte_char_to_unibyte (c, rev_tbl);
2486 } 2479 }