From: Tilghman Lesher Date: Mon, 7 Apr 2008 17:51:49 +0000 (+0000) Subject: Force ast_mktime() to check for DST, since strptime(3) does not. X-Git-Tag: 1.4.20-rc1~91 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=dccfa36f8e922b2643aecfb0a80036f5093d0b0f;p=thirdparty%2Fasterisk.git Force ast_mktime() to check for DST, since strptime(3) does not. (Closes issue #12374) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@113117 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/funcs/func_strings.c b/funcs/func_strings.c index b01bec7124..10c274efd8 100644 --- a/funcs/func_strings.c +++ b/funcs/func_strings.c @@ -499,6 +499,8 @@ static int acf_strptime(struct ast_channel *chan, char *cmd, char *data, if (!strptime(args.timestring, args.format, &time)) { ast_log(LOG_WARNING, "C function strptime() output nothing?!!\n"); } else { + /* Since strptime(3) does not check DST, force ast_mktime() to calculate it. */ + time.tm_isdst = -1; snprintf(buf, len, "%d", (int) ast_mktime(&time, args.timezone)); }