aboutsummaryrefslogtreecommitdiffstats
path: root/funcs
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-04-07 19:08:45 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-04-07 19:08:45 +0000
commitc2419f9cd423e5412361deb80a708755a0f6b5a2 (patch)
treea0083a2c251f17afde498cab3c68a343ad8a6219 /funcs
parent856e918f390615199d0e07bf152e7a92a9485727 (diff)
Merged revisions 113172 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r113172 | tilghman | 2008-04-07 14:06:46 -0500 (Mon, 07 Apr 2008) | 11 lines Merged revisions 113117 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r113117 | tilghman | 2008-04-07 12:51:49 -0500 (Mon, 07 Apr 2008) | 3 lines Force ast_mktime() to check for DST, since strptime(3) does not. (Closes issue #12374) ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@113173 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'funcs')
-rw-r--r--funcs/func_strings.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/funcs/func_strings.c b/funcs/func_strings.c
index 45d476ef2..f50ea245d 100644
--- a/funcs/func_strings.c
+++ b/funcs/func_strings.c
@@ -704,7 +704,10 @@ static int acf_strptime(struct ast_channel *chan, const char *cmd, char *data,
if (!strptime(args.timestring, args.format, &t.time)) {
ast_log(LOG_WARNING, "C function strptime() output nothing?!!\n");
} else {
- struct timeval tv = ast_mktime(&t.atm, args.timezone);
+ struct timeval tv;
+ /* Since strptime(3) does not check DST, force ast_mktime() to calculate it. */
+ t.atm.tm_isdst = -1;
+ tv = ast_mktime(&t.atm, args.timezone);
snprintf(buf, len, "%d", (int) tv.tv_sec);
}