www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/04/25/12:46:38

X-Spam-Check-By: sourceware.org
Date: Tue, 25 Apr 2006 18:46:27 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: [Patch] patch -Z not working if timestamp contains seconds >=59.5
Message-ID: <20060425164627.GA17484@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <1FYLWN-0KKWBs0 AT fwd33 DOT aul DOT t-online DOT de> <20060425120713 DOT GO28583 AT calimero DOT vinschen DOT de> <1FYOLi-0XgDOy0 AT fwd30 DOT aul DOT t-online DOT de>
Mime-Version: 1.0
In-Reply-To: <1FYOLi-0XgDOy0@fwd30.aul.t-online.de>
User-Agent: Mutt/1.4.2i
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Apr 25 16:17, Christian Franke wrote:
> Corinna Vinschen wrote:
> > Can you tell me exactly where the problem
> > happens which leads to this patch, please?
> 
> partime.c:
> ...
> parse_pattern_letter (s, c, t)
> ...
> case 's': /* second [00-60 followed by optional fraction] */
>   {
>     int frac;
>     s = parse_decimal (s, 2, 0, 60, 1, &t->tm.tm_sec, &frac);
>     t->tm.tm_sec += frac;
>   }
> 
> parse_decimal("59.50001", ...) returns tm_sec = 59 and frac=1 which
> results in tm_sec=60, but maketime({...; tm.tm_sec=60;...}, .) returns
> -1 always.

Yeah, these are exactly the lines which you patch.  When I asked for
where exactly the problem happens, I was asking where maketime makes the
mistake of not taking denormalized timestamps into account, where the
condition is which let it return -1.

Don't get me wrong, I appreciate the patch, but since you provided a
patch, I assumed you already debugged this problem, so you can point to
the place where it happens.  Yes, I'm a lazy chicken and I'm just trying
to avoid double work ;-)


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019