1
0
mirror of https://github.com/irssi/irssi.git synced 2024-10-27 05:20:20 -04:00

/exec -interactive window items didn't have get_target() which crashed

irssi at some point if they were used. patch by peder.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2834 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2002-06-04 20:47:36 +00:00 committed by cras
parent 8d41e24b58
commit 1c2be864ee

View File

@ -58,6 +58,11 @@ static void exec_wi_destroy(EXEC_WI_REC *rec)
g_free(rec); g_free(rec);
} }
static const char *exec_get_target(WI_ITEM_REC *item)
{
return ((EXEC_WI_REC *) item)->visible_name;
}
static EXEC_WI_REC *exec_wi_create(WINDOW_REC *window, PROCESS_REC *rec) static EXEC_WI_REC *exec_wi_create(WINDOW_REC *window, PROCESS_REC *rec)
{ {
EXEC_WI_REC *item; EXEC_WI_REC *item;
@ -68,6 +73,7 @@ static EXEC_WI_REC *exec_wi_create(WINDOW_REC *window, PROCESS_REC *rec)
item = g_new0(EXEC_WI_REC, 1); item = g_new0(EXEC_WI_REC, 1);
item->type = module_get_uniq_id_str("WINDOW ITEM TYPE", "EXEC"); item->type = module_get_uniq_id_str("WINDOW ITEM TYPE", "EXEC");
item->destroy = (void (*) (WI_ITEM_REC *)) exec_wi_destroy; item->destroy = (void (*) (WI_ITEM_REC *)) exec_wi_destroy;
item->get_target = exec_get_target;
item->visible_name = rec->name != NULL ? g_strdup(rec->name) : item->visible_name = rec->name != NULL ? g_strdup(rec->name) :
g_strdup_printf("%%%d", rec->id); g_strdup_printf("%%%d", rec->id);