mirror of https://github.com/djcb/mu.git
Guard against nil in mu4e~guess-maildir (Fixes #472)
Add a guard so we don't error out if string-match evaluates to nil
This commit is contained in:
parent
ea5bbdf830
commit
efb40abaa1
|
@ -1,6 +1,6 @@
|
||||||
;;; mu4e-utils.el -- part of mu4e, the mu mail user agent
|
;;; mu4e-utils.el -- part of mu4e, the mu mail user agent
|
||||||
;;
|
;;
|
||||||
;; Copyright (C) 2011-2012 Dirk-Jan C. Binnema
|
;; Copyright (C) 2011-2014 Dirk-Jan C. Binnema
|
||||||
;; Copyright (C) 2013 Tibor Simko
|
;; Copyright (C) 2013 Tibor Simko
|
||||||
|
|
||||||
;; Author: Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
;; Author: Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
||||||
|
@ -154,12 +154,13 @@ see its docstring)."
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
(defun mu4e~guess-maildir (path)
|
(defun mu4e~guess-maildir (path)
|
||||||
"Guess the maildir for some path, or nil if cannot find it."
|
"Guess the maildir for some path, or nil if cannot find it."
|
||||||
(when (zerop (string-match mu4e-maildir path))
|
(let ((idx (string-match mu4e-maildir path)))
|
||||||
(replace-regexp-in-string
|
(when (and idx (zerop idx))
|
||||||
mu4e-maildir
|
(replace-regexp-in-string
|
||||||
""
|
mu4e-maildir
|
||||||
(expand-file-name
|
""
|
||||||
(concat path "/../..")))))
|
(expand-file-name
|
||||||
|
(concat path "/../.."))))))
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue