do not mess with dst status after running localtime, the system gets confused otherwh...
[rrdtool.git] / src / parsetime.c
index a2b76ed..8818f1c 100644 (file)
@@ -232,7 +232,7 @@ static const struct SpecialToken TimeMultipliers[] = {
  * required for us to be able distinguish between 'mon' as 'month'
  * and 'mon' as 'monday'
  */
-static struct SpecialToken *Specials;
+static const struct SpecialToken *Specials;
 
 static const char **scp;    /* scanner - pointer at arglist */
 static char scc;        /* scanner - count of remaining arguments */
@@ -848,7 +848,7 @@ char     *parsetime(
     ptv->type = ABSOLUTE_TIME;
     ptv->offset = 0;
     ptv->tm = *localtime(&now);
-    ptv->tm.  tm_isdst = -1;    /* mk time can figure this out for us ... */
+    ptv->tm.  tm_isdst = -1;    /* mk time can figure dst by default ... */
 
     token();
     switch (sc_tokid) {
@@ -978,8 +978,6 @@ char     *parsetime(
         panic(e("unparsable trailing text: '...%s%s'", sc_token, sct));
     }
 
-    ptv->tm.  tm_isdst = -1;    /* for mktime to guess DST status */
-
     if (ptv->type == ABSOLUTE_TIME)
         if (mktime(&ptv->tm) == -1) {   /* normalize & check */
             /* can happen for "nonexistent" times, e.g. around 3am */