mirror of
https://github.com/vim/vim.git
synced 2025-09-26 04:04:07 -04:00
updated for version 7.4.323
Problem: Substitute() with zero width pattern breaks multi-byte character. Solution: Take multi-byte character size into account. (Yukihiro Nakadaira)
This commit is contained in:
@@ -24848,8 +24848,11 @@ do_string_sub(str, pat, sub, flags)
|
||||
if (zero_width == regmatch.startp[0])
|
||||
{
|
||||
/* avoid getting stuck on a match with an empty string */
|
||||
*((char_u *)ga.ga_data + ga.ga_len) = *tail++;
|
||||
++ga.ga_len;
|
||||
i = MB_PTR2LEN(tail);
|
||||
mch_memmove((char_u *)ga.ga_data + ga.ga_len, tail,
|
||||
(size_t)i);
|
||||
ga.ga_len += i;
|
||||
tail += i;
|
||||
continue;
|
||||
}
|
||||
zero_width = regmatch.startp[0];
|
||||
|
Reference in New Issue
Block a user