diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-01-18 21:11:34 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-01-18 21:11:34 +0000 |
commit | 04e53aad5bf10c5d5a279d25cb81af62d0a5f5a9 (patch) | |
tree | a1b794cc17e55d4e097ee8b012916df9ded8624d /stdtime | |
parent | 3e824e61f41b3140c5f0e8a94ab9a52fcc69ba17 (diff) |
If a timezone is not specified, assume localtime (instead of gmtime) (Issue #7748)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@51255 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'stdtime')
-rw-r--r-- | stdtime/localtime.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/stdtime/localtime.c b/stdtime/localtime.c index db125d9e6..e620d27be 100644 --- a/stdtime/localtime.c +++ b/stdtime/localtime.c @@ -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 @@ 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 |