1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-29 06:16:40 +02:00

Fix broken time in backlog displayed by logger plugin: use DST for time displayed in buffer (bug #26074)

This commit is contained in:
Sebastien Helleu
2009-04-03 10:38:24 +02:00
parent d8826195cc
commit ddb2eef1c5
+7 -1
View File
@@ -751,7 +751,7 @@ logger_backlog (struct t_gui_buffer *buffer, const char *filename, int lines)
{
struct t_logger_line *last_lines, *ptr_lines;
char *pos_message, *error;
time_t datetime;
time_t datetime, time_now;
struct tm tm_line;
int num_lines;
@@ -764,7 +764,13 @@ logger_backlog (struct t_gui_buffer *buffer, const char *filename, int lines)
pos_message = strchr (ptr_lines->data, '\t');
if (pos_message)
{
/* initialize structure, because strptime does not do it */
memset (&tm_line, 0, sizeof (struct tm));
/* we get current time to initialize daylight saving time in
structure tm_line, otherwise printed time will be shifted
and will not use DST used on machine */
time_now = time (NULL);
localtime_r (&time_now, &tm_line);
pos_message[0] = '\0';
error = strptime (ptr_lines->data,
weechat_config_string (logger_config_file_time_format),