Commit a5ca0e0f a5ca0e0ff2e3b79fa4b09e11d2e0183dc9971102 by Sergey Poznyakoff

Bugfix.

* mailbox/parsedate.y (DATE_SET): Change >= comparison to strict >.
(__SET_SECOND,__SET_MINUTE,__SET_HOUR): Fix upper limit.
1 parent 46958d50
...@@ -130,19 +130,19 @@ struct pd_date ...@@ -130,19 +130,19 @@ struct pd_date
130 do \ 130 do \
131 { \ 131 { \
132 int __x = val; \ 132 int __x = val; \
133 if (((m) != PD_MASK_TZ && __x < 0) || (lim && __x >= lim)) onerror; \ 133 if (((m) != PD_MASK_TZ && __x < 0) || (lim && __x > lim)) onerror; \
134 date . memb = __x; date.mask |= m; \ 134 date . memb = __x; date.mask |= m; \
135 } \ 135 } \
136 while (0) 136 while (0)
137 137
138 #define __SET_SECOND(d,v,a) DATE_SET(d,second,PD_MASK_SECOND,v,60,a) 138 #define __SET_SECOND(d,v,a) DATE_SET(d,second,PD_MASK_SECOND,v,59,a)
139 #define __SET_MINUTE(d,v,a) DATE_SET(d,minute,PD_MASK_MINUTE,v,60,a) 139 #define __SET_MINUTE(d,v,a) DATE_SET(d,minute,PD_MASK_MINUTE,v,59,a)
140 #define __SET_HOUR(d,v,a) DATE_SET(d,hour,PD_MASK_HOUR,v,24,a) 140 #define __SET_HOUR(d,v,a) DATE_SET(d,hour,PD_MASK_HOUR,v,23,a)
141 #define __SET_DAY(d,v,a) DATE_SET(d,day,PD_MASK_DAY,v,31,a) 141 #define __SET_DAY(d,v,a) DATE_SET(d,day,PD_MASK_DAY,v,31,a)
142 #define __SET_MONTH(d,v,a) DATE_SET(d,month,PD_MASK_MONTH,v,12,a) 142 #define __SET_MONTH(d,v,a) DATE_SET(d,month,PD_MASK_MONTH,v,12,a)
143 #define __SET_YEAR(d,v,a) DATE_SET(d,year,PD_MASK_YEAR,v,0,a) 143 #define __SET_YEAR(d,v,a) DATE_SET(d,year,PD_MASK_YEAR,v,0,a)
144 #define __SET_TZ(d,v,a) DATE_SET(d,tz,PD_MASK_TZ,v,0,a) 144 #define __SET_TZ(d,v,a) DATE_SET(d,tz,PD_MASK_TZ,v,0,a)
145 #define __SET_MERIDIAN(d,v,a) DATE_SET(d,meridian,PD_MASK_MERIDIAN,v,MER24+1,a) 145 #define __SET_MERIDIAN(d,v,a) DATE_SET(d,meridian,PD_MASK_MERIDIAN,v,MER24,a)
146 #define __SET_ORDINAL(d,v,a) DATE_SET(d,ordinal,PD_MASK_ORDINAL,v,0,a) 146 #define __SET_ORDINAL(d,v,a) DATE_SET(d,ordinal,PD_MASK_ORDINAL,v,0,a)
147 #define __SET_NUMBER(d,v,a) DATE_SET(d,number,PD_MASK_NUMBER,v,0,a) 147 #define __SET_NUMBER(d,v,a) DATE_SET(d,number,PD_MASK_NUMBER,v,0,a)
148 148
......