The previous code was only correct as long as the timestamp prefix
was only a single character. But with the recent change to a
multi-character prefix, this broke. So fix it now.
static char *
timestamp_db_key (const char *key)
{
- if (strlen (key) + 1 > NOTMUCH_TERM_MAX) {
+ int term_len = strlen (_find_prefix ("timestamp")) + strlen (key);
+
+ if (term_len > NOTMUCH_TERM_MAX)
return notmuch_sha1_of_string (key);
- } else {
+ else
return strdup (key);
- }
}
notmuch_status_t