mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
$winref and $winname shouldn't crash if there's no active window.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2201 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
e558f1252a
commit
2e78d926ef
@ -25,6 +25,9 @@
|
||||
/* Window ref# */
|
||||
static char *expando_winref(SERVER_REC *server, void *item, int *free_ret)
|
||||
{
|
||||
if (active_win == NULL)
|
||||
return "";
|
||||
|
||||
*free_ret = TRUE;
|
||||
return g_strdup_printf("%d", active_win->refnum);
|
||||
}
|
||||
@ -32,6 +35,9 @@ static char *expando_winref(SERVER_REC *server, void *item, int *free_ret)
|
||||
/* Window name */
|
||||
static char *expando_winname(SERVER_REC *server, void *item, int *free_ret)
|
||||
{
|
||||
if (active_win == NULL)
|
||||
return "";
|
||||
|
||||
return active_win->name;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user