mirror of
https://github.com/irssi/irssi.git
synced 2026-08-11 12:53:42 +02:00
Leverage string_policy().
This commit is contained in:
parent
2c8648a9c8
commit
21c07c0060
4 changed files with 9 additions and 8 deletions
|
|
@ -28,9 +28,9 @@
|
|||
/* Provide is_utf8(): */
|
||||
#include "recode.h"
|
||||
|
||||
int string_advance(char const **str, gboolean utf8)
|
||||
int string_advance(char const **str, int policy)
|
||||
{
|
||||
if (utf8) {
|
||||
if (policy == TREAT_STRING_AS_UTF8) {
|
||||
gunichar c;
|
||||
|
||||
c = g_utf8_get_char(*str);
|
||||
|
|
@ -38,6 +38,7 @@ int string_advance(char const **str, gboolean utf8)
|
|||
|
||||
return unichar_isprint(c) ? mk_wcwidth(c) : 1;
|
||||
} else {
|
||||
/* Assume TREAT_STRING_AS_BYTES: */
|
||||
*str += 1;
|
||||
|
||||
return 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue