Ticket #287: 0003-Correct-polarity-on-gmtoff-to-tmvec-conversions-fixe.patch

File 0003-Correct-polarity-on-gmtoff-to-tmvec-conversions-fixe.patch, 1.2 KB (added by Jim Ursetto, 14 years ago)
  • posixunix.scm

    From 6c358db38be7feb49fc201bf076e71828ef68c7b Mon Sep 17 00:00:00 2001
    From: zbigniew <zbigniewsz@gmail.com>
    Date: Mon, 19 Jul 2010 16:26:41 -0500
    Subject: [PATCH] Correct polarity on gmtoff to tmvec conversions (fixes time->string TZ)
    
    ---
     posixunix.scm |    4 ++--
     1 files changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/posixunix.scm b/posixunix.scm
    index e476828..2fbf528 100644
    a b static time_t timegm(struct tm *t) 
    370370    (ptm)->tm_isdst = (C_block_item((v), 8) != C_SCHEME_FALSE))
    371371
    372372#define cpy_tmvec_to_tmstc9(ptm, v) \
    373     (((struct tm *)ptm)->tm_gmtoff = C_unfix(C_block_item((v), 9)))
     373    (((struct tm *)ptm)->tm_gmtoff = -C_unfix(C_block_item((v), 9)))
    374374
    375375#define cpy_tmstc08_to_tmvec(v, ptm) \
    376376    (C_set_block_item((v), 0, C_fix(((struct tm *)ptm)->tm_sec)), \
    static time_t timegm(struct tm *t) 
    384384    C_set_block_item((v), 8, ((ptm)->tm_isdst ? C_SCHEME_TRUE : C_SCHEME_FALSE)))
    385385
    386386#define cpy_tmstc9_to_tmvec(v, ptm) \
    387     (C_set_block_item((v), 9, C_fix((ptm)->tm_gmtoff)))
     387    (C_set_block_item((v), 9, C_fix(-(ptm)->tm_gmtoff)))
    388388
    389389#define C_tm_set_08(v)  cpy_tmvec_to_tmstc08( &C_tm, (v) )
    390390#define C_tm_set_9(v)   cpy_tmvec_to_tmstc9( &C_tm, (v) )