You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by tr...@apache.org on 2012/08/11 22:42:45 UTC

svn commit: r1372022 - /apr/apr/trunk/time/win32/time.c

Author: trawick
Date: Sat Aug 11 20:42:45 2012
New Revision: 1372022

URL: http://svn.apache.org/viewvc?rev=1372022&view=rev
Log:
apr_time_exp_*() on Windows: Fix error in the tm_yday field of
apr_time_exp_t for times within leap years.

PR: 53175

Modified:
    apr/apr/trunk/time/win32/time.c

Modified: apr/apr/trunk/time/win32/time.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/time/win32/time.c?rev=1372022&r1=1372021&r2=1372022&view=diff
==============================================================================
--- apr/apr/trunk/time/win32/time.c (original)
+++ apr/apr/trunk/time/win32/time.c Sat Aug 11 20:42:45 2012
@@ -32,7 +32,7 @@
 /* Leap year is any year divisible by four, but not by 100 unless also
  * divisible by 400
  */
-#define IsLeapYear(y) ((!(y % 4)) ? (((!(y % 400)) && (y % 100)) ? 1 : 0) : 0)
+#define IsLeapYear(y) ((!(y % 4)) ? (((y % 400) && !(y % 100)) ? 0 : 1) : 0)
 
 static DWORD get_local_timezone(TIME_ZONE_INFORMATION **tzresult)
 {