summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2009-04-03 10:38:24 +0200
committerSebastien Helleu <flashcode@flashtux.org>2009-04-03 10:38:24 +0200
commitddb2eef1c5fc2f0aa3195aa36f1ada926a94895c (patch)
tree3bc0b38012ba7159f110025161e9b3d43891daf0 /src/plugins
parentd8826195cc1bfe26a891ae2ad1bce832a6535581 (diff)
downloadweechat-ddb2eef1c5fc2f0aa3195aa36f1ada926a94895c.zip
Fix broken time in backlog displayed by logger plugin: use DST for time displayed in buffer (bug #26074)
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/logger/logger.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/plugins/logger/logger.c b/src/plugins/logger/logger.c
index 9abff3d4e..48360cc75 100644
--- a/src/plugins/logger/logger.c
+++ b/src/plugins/logger/logger.c
@@ -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),