summaryrefslogtreecommitdiff
path: root/main/stdtime
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2007-01-18 21:15:59 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2007-01-18 21:15:59 +0000
commit9d74ea97c006434b35b60de505b42008e5ac3226 (patch)
tree771b8c8898f7a649c70b90799d5988cae6829aeb /main/stdtime
parent68d39c2b72c7b0d5e6f84731c0aae3eebb77da18 (diff)
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) ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@51257 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/stdtime')
-rw-r--r--main/stdtime/localtime.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/main/stdtime/localtime.c b/main/stdtime/localtime.c
index effb987cb..e54f2affd 100644
--- a/main/stdtime/localtime.c
+++ b/main/stdtime/localtime.c
@@ -61,6 +61,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/lock.h"
#include "asterisk/localtime.h"
+#include "asterisk/strings.h"
#ifndef lint
#ifndef NOID
@@ -1055,7 +1056,7 @@ const char * const zone;
#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 @@ const char * const zone;
#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