From 3729735e752dc15e78463108e1c37bbed1962283 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 22 Apr 2020 15:13:18 +0200 Subject: xapian: sanitize-date-range: Ensure that datestamps are 8 characters wide. --- mumi/xapian.scm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) -- cgit v1.2.3