summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmanuele Giaquinta <exg@irssi.org>2007-02-25 17:42:54 +0000
committerexg <exg@dbcabf3a-b0e7-0310-adc4-f8d773084564>2007-02-25 17:42:54 +0000
commitd00a44ca0b80e923a0413c92a6dcae6d1ad2a654 (patch)
tree4ba5ee5898949a7ed32c495e06d408991f691e0f
parentda4303be0705abe6447a8cc508b82889f5c0bc72 (diff)
downloadirssi-d00a44ca0b80e923a0413c92a6dcae6d1ad2a654.zip
Do not print an empty line for "daychange" if the formatted string is empty.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4428 dbcabf3a-b0e7-0310-adc4-f8d773084564
-rw-r--r--src/fe-common/core/fe-windows.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/fe-common/core/fe-windows.c b/src/fe-common/core/fe-windows.c
index 06621c77..4e0cba5d 100644
--- a/src/fe-common/core/fe-windows.c
+++ b/src/fe-common/core/fe-windows.c
@@ -574,14 +574,15 @@ static void window_print_daychange(WINDOW_REC *window, struct tm *tm)
THEME_REC *theme;
TEXT_DEST_REC dest;
char *format, str[256];
+ int ret;
theme = active_win->theme != NULL ? active_win->theme : current_theme;
format_create_dest(&dest, NULL, NULL, MSGLEVEL_NEVER, window);
format = format_get_text_theme(theme, MODULE_NAME, &dest,
TXT_DAYCHANGE);
- if (strftime(str, sizeof(str), format, tm) <= 0)
- str[0] = '\0';
+ ret = strftime(str, sizeof(str), format, tm);
g_free(format);
+ if (ret <= 0) return;
printtext_string_window(window, MSGLEVEL_NEVER, str);
}