If seconds are not specified in the string to be parsed, they're not
set according to the reference time (in the no rounding case) nor
rounded properly (in the rounding up cases). Fix this.
The bug caused searches such as date:10:30..10:30 to match messages
with date exactly 10:30:00 only, and not in range 10:30:00..10:30:59
(inclusive) as documented.
Note that date searches referring "noon" or "5pm" will still be
interpreted as exact to the second.
return set_user_tz (state, state->delim, v1, v2);
}
- if (!is_valid_time (v1, v2, v3))
+ if (!is_valid_time (v1, v2, n3 ? v3 : 0))
return -PARSE_TIME_ERR_INVALIDTIME;
- return set_abs_time (state, v1, v2, n3 ? v3 : 0);
+ return set_abs_time (state, v1, v2, n3 ? (int) v3 : UNSET);
}
/* strtoul helper that assigns length. */
test_expect_equal_file INPUT OUTPUT
test_begin_subtest "Second rounding tests"
-test_subtest_known_broken
REFERENCE=$(_date Tue Jan 11 12:13:14 +0000 2011)
cat <<EOF > INPUT
9:15 ==> Tue Jan 11 09:15:14 +0000 2011