mirror of
https://github.com/irssi/irssi.git
synced 2026-08-09 20:00:23 +02:00
Move check on term_type outside of strlen_big5.
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4917 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
ba002bbc13
commit
da86080d40
1 changed files with 6 additions and 4 deletions
|
|
@ -110,9 +110,6 @@ int strlen_big5(const unsigned char *str)
|
|||
{
|
||||
int len=0;
|
||||
|
||||
if (term_type != TERM_TYPE_BIG5)
|
||||
return strlen(str);
|
||||
|
||||
while (*str != '\0') {
|
||||
if (is_big5(str[0], str[1]))
|
||||
str++;
|
||||
|
|
@ -449,7 +446,12 @@ void gui_entry_insert_text(GUI_ENTRY_REC *entry, const char *str)
|
|||
|
||||
gui_entry_redraw_from(entry, entry->pos);
|
||||
|
||||
len = !entry->utf8 ? strlen_big5(str) : strlen_utf8(str);
|
||||
if (entry->utf8)
|
||||
len = strlen_utf8(str);
|
||||
else if (term_type == TERM_TYPE_BIG5)
|
||||
len = strlen_big5(str);
|
||||
else
|
||||
len = strlen(str);
|
||||
entry_text_grow(entry, len);
|
||||
|
||||
/* make space for the string */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue