summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2020-04-22 15:13:18 +0200
committerRicardo Wurmus <rekado@elephly.net>2020-04-22 15:13:18 +0200
commit3729735e752dc15e78463108e1c37bbed1962283 (patch)
treebe7977389a582977b2fa16257d3df5929273ecaa
parent07f53018def462160033a82429634d49707d13db (diff)
xapian: sanitize-date-range: Ensure that datestamps are 8 characters wide.
-rw-r--r--mumi/xapian.scm4
1 files changed, 3 insertions, 1 deletions
diff --git a/mumi/xapian.scm b/mumi/xapian.scm
index 9630274..613e9f9 100644
--- a/mumi/xapian.scm
+++ b/mumi/xapian.scm
@@ -142,7 +142,9 @@ messages and index their contents in the Xapian database at DBPATH."
(define (range-boundary->date-string boundary*)
(define boundary (string-delete #\- boundary*))
(cond
- ((string->number boundary) boundary)
+ ((and (string->number boundary)
+ (<= (string-length boundary) 8))
+ (format #f "~8,,,'0a" boundary))
(else
(let ((date (match boundary
((or "now" "today") now)