summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/fe-common/core/utf8.h1
-rw-r--r--src/fe-common/irc/fe-ircnet.c2
-rw-r--r--src/fe-text/textbuffer.c12
-rw-r--r--src/irc/core/irc-servers.c2
-rw-r--r--src/perl/textui/TextUI.xs4
-rw-r--r--src/perl/ui/Formats.xs6
6 files changed, 22 insertions, 5 deletions
diff --git a/src/fe-common/core/utf8.h b/src/fe-common/core/utf8.h
index 163f1717..3c15dc7d 100644
--- a/src/fe-common/core/utf8.h
+++ b/src/fe-common/core/utf8.h
@@ -12,5 +12,6 @@
int mk_wcwidth(unichar c);
#define unichar_isprint(c) (((c) & ~0x80) >= 32)
+#define is_utf8_leading(c) (((c) & 0xc0) != 0x80)
#endif
diff --git a/src/fe-common/irc/fe-ircnet.c b/src/fe-common/irc/fe-ircnet.c
index b35ae898..6618edd7 100644
--- a/src/fe-common/irc/fe-ircnet.c
+++ b/src/fe-common/irc/fe-ircnet.c
@@ -82,7 +82,7 @@ static void cmd_network_list(void)
}
/* SYNTAX: NETWORK ADD [-nick <nick>] [-user <user>] [-realname <name>]
- [-host <host>] [-autosendcmd <cmd>]
+ [-host <host>] [-usermode <mode>] [-autosendcmd <cmd>]
[-querychans <count>] [-whois <count>] [-msgs <count>]
[-kicks <count>] [-modes <count>]
[-cmdspeed <ms>] [-cmdmax <count>] <name> */
diff --git a/src/fe-text/textbuffer.c b/src/fe-text/textbuffer.c
index 0ba7d16e..69f5969c 100644
--- a/src/fe-text/textbuffer.c
+++ b/src/fe-text/textbuffer.c
@@ -23,6 +23,7 @@
#include "module.h"
#include "misc.h"
#include "formats.h"
+#include "utf8.h"
#include "textbuffer.h"
@@ -154,6 +155,17 @@ static void text_chunk_append(TEXT_BUFFER_REC *buffer,
chunk = buffer->cur_text;
while (chunk->pos + len >= TEXT_CHUNK_USABLE_SIZE) {
left = TEXT_CHUNK_USABLE_SIZE - chunk->pos;
+
+ /* don't split utf-8 character. (assume we can split non-utf8 anywhere.) */
+ if (left < len && !is_utf8_leading(data[left])) {
+ int i;
+ for (i = 1; i < 4 && left >= i; i++)
+ if (is_utf8_leading(data[left - i])) {
+ left -= i;
+ break;
+ }
+ }
+
if (left > 0 && data[left-1] == 0)
left--; /* don't split the commands */
diff --git a/src/irc/core/irc-servers.c b/src/irc/core/irc-servers.c
index 787044b3..e5f86c20 100644
--- a/src/irc/core/irc-servers.c
+++ b/src/irc/core/irc-servers.c
@@ -167,7 +167,7 @@ static void server_init(IRC_SERVER_REC *server)
(GCompareFunc) g_istr_equal);
/* set the standards */
- g_hash_table_insert(server->isupport, g_strdup("CHANMODES"), g_strdup("beIqd,k,lfJ,imnpst"));
+ g_hash_table_insert(server->isupport, g_strdup("CHANMODES"), g_strdup("beI,k,l,imnpst"));
g_hash_table_insert(server->isupport, g_strdup("PREFIX"), g_strdup("(ohv)@%+"));
server->cmdcount = 0;
diff --git a/src/perl/textui/TextUI.xs b/src/perl/textui/TextUI.xs
index 67c4c87b..84320ffa 100644
--- a/src/perl/textui/TextUI.xs
+++ b/src/perl/textui/TextUI.xs
@@ -175,7 +175,7 @@ CODE:
OUTPUT:
RETVAL
-MODULE = Irssi::TextUI PACKAGE = Irssi::UI::Server
+MODULE = Irssi::TextUI PACKAGE = Irssi::Server
void
gui_printtext_after(server, target, prev, level, str)
@@ -195,6 +195,8 @@ BOOT:
irssi_boot(TextUI__TextBuffer);
irssi_boot(TextUI__TextBufferView);
+MODULE = Irssi::TextUI PACKAGE = Irssi
+
void
term_refresh_freeze()
diff --git a/src/perl/ui/Formats.xs b/src/perl/ui/Formats.xs
index 7ff31aac..ba28f247 100644
--- a/src/perl/ui/Formats.xs
+++ b/src/perl/ui/Formats.xs
@@ -73,17 +73,18 @@ MODULE = Irssi::UI::Formats PACKAGE = Irssi::UI::Window
#*******************************
void
-format_get_text(window, module, server, target, formatnum, ...)
+format_get_text(window, module, server, target, format, ...)
Irssi::UI::Window window
char *module
Irssi::Server server
char *target
- int formatnum
+ char *format
PREINIT:
TEXT_DEST_REC dest;
THEME_REC *theme;
char **charargs;
char *ret;
+ int formatnum;
int n;
PPCODE:
charargs = g_new0(char *, items-5+1);
@@ -93,6 +94,7 @@ PPCODE:
format_create_dest(&dest, server, target, 0, window);
theme = window_get_theme(dest.window);
+ formatnum = format_find_tag(module, format);
ret = format_get_text_theme_charargs(theme, module, &dest, formatnum, charargs);
g_free(charargs);