scsh-users
[Top] [All Lists]

time/date bugs in 0.5.0

To: scsh-news@martigny.ai.mit.edu
Subject: time/date bugs in 0.5.0
From: Leif Nixon <nixon@softlab.se>
Date: 24 Apr 1997 20:25:50 +0200
Organization: Ericsson
Sigh, I'm still getting bitten by the 'date' function. This
time on my Linux box. Look:

  Scsh 0.5
  > (date)

  Error: insufficient number of arguments to FORMAT
  1>

It seems I'm going down cond branches where no man has gone
before. The argument 'name' seems to be missing from the
last two 'format' calls in 'format-time-zone' in
time.scm. They *should* look like this, if I'm not mistaken:

          (if (zero? s)
              (if (zero? m)
                  (format #f "~a~a~d" name sign h)      ; name+h
                  (format #f "~a~a~a:~a"                ; name+hh:mm
                          name sign (two-digits h) (two-digits m)))
              (format #f "~a~a~a:~a:~a"                 ; name+hh:mm:ss
                      name sign (two-digits h) (two-digits m) (two-digits 
s)))))))

The reason I wind up in this cond branch is that I'm getting
bogus results from time2date() in time1.c. Yes, it's another
mktime() call that returns -1. To be precise, this one:

  #ifdef HAVE_GMTOFF      
          *tz_secs = d.tm_gmtoff;
  #else
          { char **oldenv = environ;                    /* Set TZ to UTC     */
            environ=utc_env;                            /* time temporarily. */
            tzset(); /* NetBSD, SunOS POSIX-noncompliance requires this. */
            *tz_secs = mktime(&d) - t;
            environ=oldenv;
            }
  #endif



Leif Nixon                             SoftLab AB
-------------------------------------------------
E-mail: nixon@softlab.se   Phone: +46 13 23 57 61
-------------------------------------------------

<Prev in Thread] Current Thread [Next in Thread>