diff options
| author | Kenichi Handa | 2002-08-20 08:32:34 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2002-08-20 08:32:34 +0000 |
| commit | 096a353dd1c93a24e64c76b8b8487bca8312541c (patch) | |
| tree | 43033fef55659f7450445176bc8adb6d1dfe34de /src | |
| parent | 16747e037d9e305a19b790ceddf3618e86fd8a4c (diff) | |
| download | emacs-096a353dd1c93a24e64c76b8b8487bca8312541c.tar.gz emacs-096a353dd1c93a24e64c76b8b8487bca8312541c.zip | |
(Freplace_match): Fix for the unibyte case.
Diffstat (limited to 'src')
| -rw-r--r-- | src/search.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/search.c b/src/search.c index 5ce999ef4d7..efc1c35bdc2 100644 --- a/src/search.c +++ b/src/search.c | |||
| @@ -2245,14 +2245,20 @@ since only regular expressions have distinguished subexpressions. */) | |||
| 2245 | { | 2245 | { |
| 2246 | /* Decide how to casify by examining the matched text. */ | 2246 | /* Decide how to casify by examining the matched text. */ |
| 2247 | int last; | 2247 | int last; |
| 2248 | int multibyte; | ||
| 2248 | 2249 | ||
| 2249 | pos = search_regs.start[sub]; | 2250 | pos = search_regs.start[sub]; |
| 2250 | last = search_regs.end[sub]; | 2251 | last = search_regs.end[sub]; |
| 2251 | 2252 | ||
| 2252 | if (NILP (string)) | 2253 | if (NILP (string)) |
| 2253 | pos_byte = CHAR_TO_BYTE (pos); | 2254 | { |
| 2255 | pos_byte = CHAR_TO_BYTE (pos); | ||
| 2256 | multibyte = ! NILP (current_buffer->enable_multibyte_characters); | ||
| 2254 | else | 2257 | else |
| 2255 | pos_byte = string_char_to_byte (string, pos); | 2258 | { |
| 2259 | pos_byte = string_char_to_byte (string, pos); | ||
| 2260 | multibyte = STRING_MULTIBYTE (string); | ||
| 2261 | } | ||
| 2256 | 2262 | ||
| 2257 | prevc = '\n'; | 2263 | prevc = '\n'; |
| 2258 | case_action = all_caps; | 2264 | case_action = all_caps; |
| @@ -2273,6 +2279,10 @@ since only regular expressions have distinguished subexpressions. */) | |||
| 2273 | } | 2279 | } |
| 2274 | else | 2280 | else |
| 2275 | FETCH_STRING_CHAR_ADVANCE (c, string, pos, pos_byte); | 2281 | FETCH_STRING_CHAR_ADVANCE (c, string, pos, pos_byte); |
| 2282 | if (! multibyte) | ||
| 2283 | { | ||
| 2284 | MAKE_CHAR_MULTIBYTE (c); | ||
| 2285 | } | ||
| 2276 | 2286 | ||
| 2277 | if (LOWERCASEP (c)) | 2287 | if (LOWERCASEP (c)) |
| 2278 | { | 2288 | { |