mirror of
https://github.com/irssi/irssi.git
synced 2026-08-11 21:00:40 +02:00
Move advance() from fe-common/core to core.
This commit is contained in:
parent
5538578820
commit
5c74a3bb88
3 changed files with 20 additions and 16 deletions
|
|
@ -26,3 +26,18 @@
|
|||
#include "module.h"
|
||||
#include "wcwidth.c"
|
||||
|
||||
int advance(char const **str, gboolean utf8)
|
||||
{
|
||||
if (utf8) {
|
||||
gunichar c;
|
||||
|
||||
c = g_utf8_get_char(*str);
|
||||
*str = g_utf8_next_char(*str);
|
||||
|
||||
return unichar_isprint(c) ? mk_wcwidth(c) : 1;
|
||||
} else {
|
||||
*str += 1;
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue