mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-23 08:20:41 -08:00
(wordify): Fix i_byte even in unibyte case for copy loop.
If input is unibyte, make the output unibyte.
This commit is contained in:
parent
09ffb8b543
commit
8a2df9371a
1 changed files with 10 additions and 3 deletions
13
src/search.c
13
src/search.c
|
|
@ -1983,8 +1983,12 @@ wordify (string)
|
|||
return build_string ("");
|
||||
|
||||
adjust = - punct_count + 5 * (word_count - 1) + 4;
|
||||
val = make_uninit_multibyte_string (len + adjust,
|
||||
STRING_BYTES (XSTRING (string)) + adjust);
|
||||
if (STRING_MULTIBYTE (string))
|
||||
val = make_uninit_multibyte_string (len + adjust,
|
||||
STRING_BYTES (XSTRING (string))
|
||||
+ adjust);
|
||||
else
|
||||
val = make_uninit_string (len + adjust);
|
||||
|
||||
o = XSTRING (val)->data;
|
||||
*o++ = '\\';
|
||||
|
|
@ -1999,7 +2003,10 @@ wordify (string)
|
|||
if (STRING_MULTIBYTE (string))
|
||||
FETCH_STRING_CHAR_ADVANCE (c, string, i, i_byte);
|
||||
else
|
||||
c = XSTRING (string)->data[i++];
|
||||
{
|
||||
c = XSTRING (string)->data[i++];
|
||||
i_byte++;
|
||||
}
|
||||
|
||||
if (SYNTAX (c) == Sword)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue