From 2e78d926efe7148e46f99ab57c8aa16816e474c4 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Thu, 6 Dec 2001 20:57:28 +0000 Subject: [PATCH] $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 --- src/fe-common/core/fe-expandos.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/fe-common/core/fe-expandos.c b/src/fe-common/core/fe-expandos.c index 8ef696f8..c14ac7c3 100644 --- a/src/fe-common/core/fe-expandos.c +++ b/src/fe-common/core/fe-expandos.c @@ -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; }