diff options
author | Douglas Christman <DouglasChristman@gmail.com> | 2016-11-24 15:51:07 -0500 |
---|---|---|
committer | Douglas Christman <DouglasChristman@gmail.com> | 2016-11-24 18:22:08 -0500 |
commit | 36ff0c979258844ca8a200f49d434997299416e6 (patch) | |
tree | 479f4dd89499344aa4532dab43b52b26d84969e9 /src/basic | |
parent | 3215e35c405278491f55fb486d349f132e93f516 (diff) |
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.
Diffstat (limited to 'src/basic')
-rw-r--r-- | src/basic/calendarspec.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/basic/calendarspec.c b/src/basic/calendarspec.c index 1de04feedf..4ef22dfffb 100644 --- a/src/basic/calendarspec.c +++ b/src/basic/calendarspec.c @@ -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; |