[asterisk-commits] tilghman: trunk r51257 - in /trunk: ./ main/stdtime/localtime.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Jan 18 14:15:59 MST 2007


Author: tilghman
Date: Thu Jan 18 15:15:59 2007
New Revision: 51257

URL: http://svn.digium.com/view/asterisk?view=rev&rev=51257
Log:
Merged revisions 51256 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r51256 | tilghman | 2007-01-18 15:14:24 -0600 (Thu, 18 Jan 2007) | 10 lines

Merged revisions 51255 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r51255 | tilghman | 2007-01-18 15:11:34 -0600 (Thu, 18 Jan 2007) | 2 lines

If a timezone is not specified, assume localtime (instead of gmtime) (Issue #7748)

........

................

Modified:
    trunk/   (props changed)
    trunk/main/stdtime/localtime.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/main/stdtime/localtime.c
URL: http://svn.digium.com/view/asterisk/trunk/main/stdtime/localtime.c?view=diff&rev=51257&r1=51256&r2=51257
==============================================================================
--- trunk/main/stdtime/localtime.c (original)
+++ trunk/main/stdtime/localtime.c Thu Jan 18 15:15:59 2007
@@ -61,6 +61,7 @@
 
 #include "asterisk/lock.h"
 #include "asterisk/localtime.h"
+#include "asterisk/strings.h"
 
 #ifndef lint
 #ifndef NOID
@@ -1055,7 +1056,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