mirror of
https://github.com/irssi/irssi.git
synced 2025-02-02 15:08:01 -05:00
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
This commit is contained in:
parent
da4303be07
commit
d00a44ca0b
@ -574,14 +574,15 @@ static void window_print_daychange(WINDOW_REC *window, struct tm *tm)
|
|||||||
THEME_REC *theme;
|
THEME_REC *theme;
|
||||||
TEXT_DEST_REC dest;
|
TEXT_DEST_REC dest;
|
||||||
char *format, str[256];
|
char *format, str[256];
|
||||||
|
int ret;
|
||||||
|
|
||||||
theme = active_win->theme != NULL ? active_win->theme : current_theme;
|
theme = active_win->theme != NULL ? active_win->theme : current_theme;
|
||||||
format_create_dest(&dest, NULL, NULL, MSGLEVEL_NEVER, window);
|
format_create_dest(&dest, NULL, NULL, MSGLEVEL_NEVER, window);
|
||||||
format = format_get_text_theme(theme, MODULE_NAME, &dest,
|
format = format_get_text_theme(theme, MODULE_NAME, &dest,
|
||||||
TXT_DAYCHANGE);
|
TXT_DAYCHANGE);
|
||||||
if (strftime(str, sizeof(str), format, tm) <= 0)
|
ret = strftime(str, sizeof(str), format, tm);
|
||||||
str[0] = '\0';
|
|
||||||
g_free(format);
|
g_free(format);
|
||||||
|
if (ret <= 0) return;
|
||||||
|
|
||||||
printtext_string_window(window, MSGLEVEL_NEVER, str);
|
printtext_string_window(window, MSGLEVEL_NEVER, str);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user