Find attached the patch I promised to send to you. Please note that there
[rrdtool.git] / src / parsetime.c
index cea967c..9ad9c55 100644 (file)
@@ -32,6 +32,9 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+/* NOTE: nothing in here is thread-safe!!!! Not even the localtime
+   calls ... */
+
 /*
  * The BNF-like specification of the time syntax parsed is below:
  *                                                               
@@ -697,6 +700,7 @@ day(struct time_value *ptv)
             */
            wday = (sc_tokid-SUN);
            ptv->tm.tm_mday += (wday - ptv->tm.tm_wday);
+            token();
            break;
            /*
            mday = ptv->tm.tm_mday;
@@ -835,7 +839,8 @@ parsetime(char *tspec, struct time_value *ptv)
     /* Only absolute time specifications below */
     case NUMBER:
            try(tod(ptv))
-           if (sc_tokid != NUMBER) break; 
+            try(day(ptv))
+            break;
     /* fix month parsing */
     case JAN: case FEB: case MAR: case APR: case MAY: case JUN:
     case JUL: case AUG: case SEP: case OCT: case NOV: case DEC: