@@ -85,9 +85,7 @@ MLN_FUNC(static, long, mln_cron_parse_minute, (mln_string_t *smin, long min), (s
85
85
if (p == head || p > head + 2 ) return -1 ;
86
86
* p = 0 ;
87
87
tmp = atol ((char * )head );
88
- if (tmp < 1 || tmp >= 60 ) {
89
- return -1 ;
90
- }
88
+ if (tmp < 1 || tmp >= 60 ) return -1 ;
91
89
if (tmp < min ) tmp += 60 ;
92
90
if (!save ) {
93
91
save = min == tmp ? min + period : tmp ;
@@ -110,7 +108,7 @@ MLN_FUNC(static, long, mln_cron_parse_minute, (mln_string_t *smin, long min), (s
110
108
if (p > head ) {
111
109
if (p > head + 2 ) return -1 ;
112
110
tmp = atol ((char * )head );
113
- if (tmp < 1 || tmp >= 60 ) return -1 ;
111
+ if (tmp < 0 || tmp >= 60 ) return -1 ;
114
112
if (tmp < min ) tmp += 60 ;
115
113
if (!save ) {
116
114
save = min == tmp ? min + period : tmp ;
@@ -178,7 +176,7 @@ MLN_FUNC(static, long, mln_cron_parse_hour, \
178
176
if (p > head ) {
179
177
if (p > head + 2 ) return -1 ;
180
178
tmp = atol ((char * )head );
181
- if (tmp < 1 || tmp >= 24 ) return -1 ;
179
+ if (tmp < 0 || tmp >= 24 ) return -1 ;
182
180
if (tmp < hour ) tmp += 24 ;
183
181
if (!save ) {
184
182
save = hour == tmp && !greater ? hour + period : tmp ;
@@ -394,6 +392,7 @@ MLN_FUNC(static, long, mln_cron_parse_week, \
394
392
if (p > head ) {
395
393
if (p > head + 1 ) return -1 ;
396
394
tmp = atol ((char * )head );
395
+ if (tmp == 7 ) tmp = 0 ;
397
396
if (tmp < 0 || tmp >= 7 ) return -1 ;
398
397
if (tmp < week ) tmp += 7 ;
399
398
if (!save ) {
0 commit comments