source: branches/backfire/toolchain/uClibc/patches-0.9.30.2/904-backport_dst_leap_months_fix.patch @ 31074

Last change on this file since 31074 was 31074, checked in by florian, 4 years ago

[backfire] backport r31073

File size: 1019 bytes
  • libc/misc/time/time.c

    From: Guillaume Bourcier <guillaumebourcier@...>
    
    The algorithm computing daylight saving time incorrectly adds a day for
    each month after January for leap years. The clock shift from/to DST can
    be delayed if the last Sunday of a transition month is exactly seven
    days before the first of the following month.
    
    This change adds a day for the February month only.
    
    Signed-off-by: Guillaume Bourcier <guillaumebourcier@...>
    Signed-off-by: Richard Braun <rbraun@...>
    ---
     libc/misc/time/time.c |    2 +-
     1 files changed, 1 insertions(+), 1 deletions(-)
    
    diff --git a/libc/misc/time/time.c b/libc/misc/time/time.c
    index 19d68e1..8e2ebf1 100644
    a b  
    705705                                        ++day; 
    706706                                } 
    707707                                monlen = 31 + day_cor[r->month -1] - day_cor[r->month]; 
    708                                 if (isleap && (r->month > 1)) { 
     708                                if (isleap && (r->month == 2)) { 
    709709                                        ++monlen; 
    710710                                } 
    711711                                /* Wweekday (0 is Sunday) of 1st of the month 
Note: See TracBrowser for help on using the repository browser.