[asterisk-commits] tilghman: branch 1.2 r51255 - /branches/1.2/stdtime/localtime.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Jan 18 14:11:35 MST 2007


Author: tilghman
Date: Thu Jan 18 15:11:34 2007
New Revision: 51255

URL: http://svn.digium.com/view/asterisk?view=rev&rev=51255
Log:
If a timezone is not specified, assume localtime (instead of gmtime) (Issue #7748)

Modified:
    branches/1.2/stdtime/localtime.c

Modified: branches/1.2/stdtime/localtime.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/stdtime/localtime.c?view=diff&rev=51255&r1=51254&r2=51255
==============================================================================
--- branches/1.2/stdtime/localtime.c (original)
+++ branches/1.2/stdtime/localtime.c Thu Jan 18 15:11:34 2007
@@ -56,6 +56,7 @@
 #include "tzfile.h"
 #include "asterisk/lock.h"
 #include "asterisk/localtime.h"
+#include "asterisk/strings.h"
 
 
 #ifndef lint
@@ -1051,7 +1052,7 @@
 #ifdef _THREAD_SAFE
 	ast_mutex_lock(&lcl_mutex);
 #endif
-	ast_tzset(zone);
+	ast_tzset(ast_strlen_zero(zone) ? "/etc/localtime" : zone);
 	localsub(timep, 0L, p_tm, zone);
 #ifdef _THREAD_SAFE
 	ast_mutex_unlock(&lcl_mutex);
@@ -1495,8 +1496,8 @@
 #ifdef	_THREAD_SAFE
 	ast_mutex_lock(&lcl_mutex);
 #endif
-	ast_tzset(zone);
-	mktime_return_value = time1(tmp, localsub, 0L, zone);
+	ast_tzset(!ast_strlen_zero(zone) ? zone : "/etc/localtime");
+	mktime_return_value = time1(tmp, localsub, 0L, !ast_strlen_zero(zone) ? zone : "/etc/localtime");
 #ifdef	_THREAD_SAFE
 	ast_mutex_unlock(&lcl_mutex);
 #endif



More information about the asterisk-commits mailing list