summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/basic/calendarspec.c5
-rw-r--r--src/test/test-calendarspec.c1
2 files changed, 6 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;
diff --git a/src/test/test-calendarspec.c b/src/test/test-calendarspec.c
index d4bb4a1707..0bb29af545 100644
--- a/src/test/test-calendarspec.c
+++ b/src/test/test-calendarspec.c
@@ -177,6 +177,7 @@ int main(int argc, char* argv[]) {
test_one("1..3-1..3 1..3:1..3", "*-01,02,03-01,02,03 01,02,03:01,02,03:00");
test_one("00:00:1.125..2.125", "*-*-* 00:00:01.125000,02.125000");
test_one("00:00:1.0..3.8", "*-*-* 00:00:01,02,03");
+ test_one("00:00:01..03", "*-*-* 00:00:01,02,03");
test_one("*-*~1 Utc", "*-*~01 00:00:00 UTC");
test_one("*-*~05,3 ", "*-*~03,05 00:00:00");
test_one("*-*~* 00:00:00", "*-*-* 00:00:00");