fixes from Irssi SVN, from Brad. "go ahead" viq (maintainer).

- Set window binds for channel items as sticky when re-creating window
binds as part of /layout save. This addresses the problem of previously
saved channel window items forgetting their windows upon reconnection,
which resulted in them being opened in new windows.

- Ensure that expando_cumode_space() doesn't free unallocated memory when no
prefix exists by conditionally allocating and marking to-be-freed the cumode
string inside of expando_cumode().
This commit is contained in:
sthen 2011-12-01 17:51:10 +00:00
parent e258a5bb66
commit 764618cd60
3 changed files with 49 additions and 2 deletions

View File

@ -1,11 +1,11 @@
# $OpenBSD: Makefile,v 1.50 2011/11/16 10:16:57 sthen Exp $ # $OpenBSD: Makefile,v 1.51 2011/12/01 17:51:10 sthen Exp $
SHARED_ONLY= Yes SHARED_ONLY= Yes
COMMENT= modular IRC client with many features (ipv6,socks,proxy) COMMENT= modular IRC client with many features (ipv6,socks,proxy)
DISTNAME= irssi-0.8.15 DISTNAME= irssi-0.8.15
REVISION= 1 REVISION= 2
CATEGORIES= net CATEGORIES= net
HOMEPAGE= http://www.irssi.org/ HOMEPAGE= http://www.irssi.org/

View File

@ -0,0 +1,25 @@
$OpenBSD: patch-src_fe-common_core_windows-layout_c,v 1.1 2011/12/01 17:51:10 sthen Exp $
--- src/fe-common/core/windows-layout.c.orig Wed Nov 16 17:10:37 2011
+++ src/fe-common/core/windows-layout.c Wed Nov 16 17:10:50 2011
@@ -152,6 +152,7 @@ static void sig_layout_save_item(WINDOW_REC *window, W
CONFIG_NODE *subnode;
CHAT_PROTOCOL_REC *proto;
const char *type;
+ WINDOW_BIND_REC *rec;
type = module_find_id_str("WINDOW ITEM TYPE", item->type);
if (type == NULL)
@@ -168,8 +169,11 @@ static void sig_layout_save_item(WINDOW_REC *window, W
if (item->server != NULL) {
iconfig_node_set_str(subnode, "tag", item->server->tag);
- if (IS_CHANNEL(item))
- window_bind_add(window, item->server->tag, item->visible_name);
+ if (IS_CHANNEL(item)) {
+ rec = window_bind_add(window, item->server->tag, item->visible_name);
+ if (rec != NULL)
+ rec->sticky = TRUE;
+ }
} else if (IS_QUERY(item)) {
iconfig_node_set_str(subnode, "tag", QUERY(item)->server_tag);
}

View File

@ -0,0 +1,22 @@
$OpenBSD: patch-src_irc_core_irc-expandos_c,v 1.1 2011/12/01 17:51:10 sthen Exp $
--- src/irc/core/irc-expandos.c.orig Wed Nov 16 17:11:24 2011
+++ src/irc/core/irc-expandos.c Wed Nov 16 17:11:37 2011
@@ -87,11 +87,13 @@ static char *expando_cumode(SERVER_REC *server, void *
{
if (IS_IRC_CHANNEL(item) && CHANNEL(item)->ownnick) {
char prefix = NICK(CHANNEL(item)->ownnick)->prefixes[0];
- char *cumode = g_malloc(2);
- cumode[0] = prefix;
- cumode[1] = '\0';
- *free_ret = TRUE;
- return cumode; /* will be "\0\0" = "" if there is no prefix */
+ if (prefix != '\0') {
+ char *cumode = g_malloc(2);
+ cumode[0] = prefix;
+ cumode[1] = '\0';
+ *free_ret = TRUE;
+ return cumode;
+ }
}
return "";
}