calendarspec: allow whole second ranges

Previously a string like "00:00:01..03" would fail to parse due to the
ambiguity between a decimal point and the start of a range.
This commit is contained in:
Douglas Christman
2016-11-24 18:22:08 -05:00
parent 3215e35c40
commit 36ff0c9792
2 changed files with 6 additions and 0 deletions
+5
View File
@@ -486,6 +486,10 @@ static int parse_component_decimal(const char **p, bool usec, unsigned long *res
if (*e == '.') {
unsigned add;
/* This is the start of a range, not a fractional part */
if (e[1] == '.')
goto finish;
e++;
r = parse_fractional_part_u(&e, 6, &add);
if (r < 0)
@@ -497,6 +501,7 @@ static int parse_component_decimal(const char **p, bool usec, unsigned long *res
}
}
finish:
*p = e;
*res = value;