long from_idx, to_idx;
try {
- from_idx = std::stol (from);
+ if (EMPTY_STRING (from))
+ from_idx = 0L;
+ else
+ from_idx = std::stol (from);
} catch (std::logic_error &e) {
_notmuch_database_log (notmuch, "bad 'from' revision: '%s'\n", from);
return NOTMUCH_STATUS_BAD_QUERY_SYNTAX;
}
try {
- to_idx = std::stol (to);
+ if (EMPTY_STRING (to))
+ to_idx = LONG_MAX;
+ else
+ to_idx = std::stol (to);
} catch (std::logic_error &e) {
_notmuch_database_log (notmuch, "bad 'to' revision: '%s'\n", to);
return NOTMUCH_STATUS_BAD_QUERY_SYNTAX;
test_expect_equal_file EXPECTED OUTPUT
test_begin_subtest "lastmod query, lower bound only"
-test_subtest_known_broken
notmuch search lastmod:$revision.. | notmuch_search_sanitize > EXPECTED
notmuch search --query=sexp "(lastmod $revision \"\")" | notmuch_search_sanitize > OUTPUT
test_expect_equal_file_nonempty EXPECTED OUTPUT
test_begin_subtest "lastmod query, upper bound only"
-test_subtest_known_broken
notmuch search lastmod:..$revision2 | notmuch_search_sanitize > EXPECTED
notmuch search --query=sexp "(lastmod \"\" $revision2)" | notmuch_search_sanitize > OUTPUT
test_expect_equal_file_nonempty EXPECTED OUTPUT