xapian: sanitize-date-range: Ensure that datestamps are 8 characters wide.
authorRicardo Wurmus <rekado@elephly.net>
Wed, 22 Apr 2020 13:13:18 +0000 (15:13 +0200)
committerRicardo Wurmus <rekado@elephly.net>
Wed, 22 Apr 2020 13:13:18 +0000 (15:13 +0200)
mumi/xapian.scm

index 9630274847c03ce4aa30c2fa72b84318bbad835a..613e9f9aec05b53a762989cb5bcacf2387b2528c 100644 (file)
@@ -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)