[Exim] bug in tod_stamp() (exim-4.20) ?

Top Page
Delete this message
Reply to this message
Author: yurik shestakov
Date:  
To: exim-users
Subject: [Exim] bug in tod_stamp() (exim-4.20) ?
Hi!

Result of fuctions strftime() is locale-dependent. So I had incorrect
email headers when LANG (or LC_TIME) =ru_UA.KOI8-U (cyrillic month and
day names in 'Date:' and 'From_').

diff -rud exim-4.20-orig/src/exim.h exim4-4.20/src/exim.h
--- exim-4.20-orig/src/exim.h    Mon May 12 16:39:18 2003
+++ exim4-4.20/src/exim.h    Thu Jun 19 09:30:35 2003
@@ -53,6 +53,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <time.h>
+#include <locale.h>


/* Unix includes */

diff -rud exim-4.20-orig/src/tod.c exim4-4.20/src/tod.c
--- exim-4.20-orig/src/tod.c    Mon May 12 16:39:22 2003
+++ exim4-4.20/src/tod.c    Thu Jun 19 09:13:22 2003
@@ -53,6 +53,9 @@
 time_t now = time(NULL);
 struct tm *t;


+/* strftime() has dependence from LC_TIME locale setting */
+setlocale(LC_TIME,"POSIX");
+
/* Vary log type according to timezone requirement */

if (type == tod_log) type = log_timezone? tod_log_zone : tod_log_bare;

--
// yurik shestakov