[asterisk-commits] tilghman: trunk r113172 - in /trunk: ./ funcs/func_strings.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Apr 7 14:06:47 CDT 2008


Author: tilghman
Date: Mon Apr  7 14:06:46 2008
New Revision: 113172

URL: http://svn.digium.com/view/asterisk?view=rev&rev=113172
Log:
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)

........

Modified:
    trunk/   (props changed)
    trunk/funcs/func_strings.c

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

Modified: trunk/funcs/func_strings.c
URL: http://svn.digium.com/view/asterisk/trunk/funcs/func_strings.c?view=diff&rev=113172&r1=113171&r2=113172
==============================================================================
--- trunk/funcs/func_strings.c (original)
+++ trunk/funcs/func_strings.c Mon Apr  7 14:06:46 2008
@@ -704,7 +704,10 @@
 	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);
 	}
 




More information about the asterisk-commits mailing list