commit 74a1fbed375bac92df1f3fea36127945f071aa84
parent 12c212e50580cbfa6d929ae444c67732af842cb7
Author: Elie Le Vaillant <eolien55@disroot.org>
Date: Fri, 6 Dec 2024 10:37:47 +0100
cron: fix '~' range parsing
'~' after number was recognized as abnormal.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cron.c b/cron.c
@@ -254,7 +254,7 @@ parserange(char *str, long low, long high, struct range *r)
errno = 0;
r->low = strtol(strlow, &e, 10);
- if (*e || errno != 0)
+ if ((*e && *e != '~') || errno != 0)
return -1;
if (strhigh) {
if (!*strhigh || range != NULL) /* i.e. N- or N-M-... */