Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
92cfbb45
Commit
92cfbb45
authored
Mar 27, 2017
by
Yury Popov
Committed by
Arnim Läuger
Mar 27, 2017
Browse files
Cron fixes (#1884)
* Fix cron values >32 * Fix crontab description items order
parent
b09cac05
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/modules/cron.c
View file @
92cfbb45
...
...
@@ -53,7 +53,7 @@ static uint64_t lcron_parsepart(lua_State *L, char *str, char **end, uint8_t min
if
(
val
<
min
||
val
>
max
)
{
return
luaL_error
(
L
,
"invalid spec (val %d out of range %d..%d)"
,
val
,
min
,
max
);
}
res
|=
(
1
<<
(
val
-
min
)
)
;
res
|=
(
uint64_t
)
1
<<
(
val
-
min
);
if
(
**
end
!=
','
)
break
;
str
=
*
end
+
1
;
}
...
...
@@ -67,11 +67,11 @@ static int lcron_parsedesc(lua_State *L, char *str, struct cronent_desc *desc) {
if
(
*
s
!=
' '
)
return
luaL_error
(
L
,
"invalid spec (separator @%d)"
,
s
-
str
);
desc
->
hour
=
lcron_parsepart
(
L
,
s
+
1
,
&
s
,
0
,
23
);
if
(
*
s
!=
' '
)
return
luaL_error
(
L
,
"invalid spec (separator @%d)"
,
s
-
str
);
desc
->
dow
=
lcron_parsepart
(
L
,
s
+
1
,
&
s
,
0
,
6
);
if
(
*
s
!=
' '
)
return
luaL_error
(
L
,
"invalid spec (separator @%d)"
,
s
-
str
);
desc
->
dom
=
lcron_parsepart
(
L
,
s
+
1
,
&
s
,
1
,
31
);
if
(
*
s
!=
' '
)
return
luaL_error
(
L
,
"invalid spec (separator @%d)"
,
s
-
str
);
desc
->
mon
=
lcron_parsepart
(
L
,
s
+
1
,
&
s
,
1
,
12
);
if
(
*
s
!=
' '
)
return
luaL_error
(
L
,
"invalid spec (separator @%d)"
,
s
-
str
);
desc
->
dow
=
lcron_parsepart
(
L
,
s
+
1
,
&
s
,
0
,
6
);
if
(
*
s
!=
0
)
return
luaL_error
(
L
,
"invalid spec (trailing @%d)"
,
s
-
str
);
return
0
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment