mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-01 00:54:24 +03:00
Merge branch '2484_editor_get_prev_utf8_fix'
* 2484_editor_get_prev_utf8_fix: Ticket #2484 (segfault after getting previous char)
This commit is contained in:
commit
4a6faa64fb
@ -1872,7 +1872,13 @@ edit_get_prev_utf (WEdit * edit, long byte_index, int *char_width)
|
||||
if (str != buf)
|
||||
str = g_utf8_find_prev_char (buf, str);
|
||||
|
||||
res = g_utf8_get_char_validated (str, -1);
|
||||
if (res < 0 || str == NULL)
|
||||
{
|
||||
*char_width = 0;
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
res = g_utf8_get_char_validated (str, -1);
|
||||
|
||||
if (res < 0)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user