diff options
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/text.c | 5 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/unit.c | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c index 7f1f6590e48..bdc82fe626c 100644 --- a/source/blender/blenkernel/intern/text.c +++ b/source/blender/blenkernel/intern/text.c @@ -933,7 +933,7 @@ void txt_move_left(Text *text, const bool sel) (*charp) -= tabsize; } else { - const char *prev = BLI_str_prev_char_utf8((*linep)->line + *charp); + const char *prev = BLI_str_find_prev_char_utf8((*linep)->line + *charp, (*linep)->line); *charp = prev - (*linep)->line; } } @@ -1938,7 +1938,8 @@ void txt_backspace_char(Text *text) txt_pop_sel(text); } else { /* Just backspacing a char */ - const char *prev = BLI_str_prev_char_utf8(text->curl->line + text->curc); + const char *prev = BLI_str_find_prev_char_utf8(text->curl->line + text->curc, + text->curl->line); size_t c_len = prev - text->curl->line; c = BLI_str_utf8_as_unicode_step(text->curl->line, text->curl->len, &c_len); c_len -= prev - text->curl->line; diff --git a/source/blender/blenkernel/intern/unit.c b/source/blender/blenkernel/intern/unit.c index 4581d410444..4e9a3c9fb2e 100644 --- a/source/blender/blenkernel/intern/unit.c +++ b/source/blender/blenkernel/intern/unit.c @@ -717,7 +717,7 @@ static const char *unit_find_str(const char *str, const char *substr, bool case_ if (str_found == str || /* Weak unicode support!, so "µm" won't match up be replaced by "m" * since non ascii utf8 values will NEVER return true */ - isalpha_or_utf8(*BLI_str_prev_char_utf8(str_found)) == 0) { + isalpha_or_utf8(*BLI_str_find_prev_char_utf8(str_found, str)) == 0) { /* Next char cannot be alphanum. */ int len_name = strlen(substr); |