[PATCH] emacs: content-type comparison should be case insensitive.

Jameson Graef Rollins jrollins at finestructure.net
Mon Mar 26 08:21:55 PDT 2012


On Sun, 25 Mar 2012 00:43:28 +0000, Mark Walters <markwalters1009 at gmail.com> wrote:
> The function notmuch-match-content-type was comparing content types
> case sensitively. Fix it so it tests case insensitively.
> 
> This fixes a bug where emacs would not include any body when replying
> to a message with content-type TEXT/PLAIN.
> ---
>  emacs/notmuch-lib.el |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
> index c146748..a754de7 100644
> --- a/emacs/notmuch-lib.el
> +++ b/emacs/notmuch-lib.el
> @@ -185,8 +185,9 @@ the user hasn't set this variable with the old or new value."
>  	(st2 (notmuch-split-content-type t2)))
>      (if (or (string= (cadr st1) "*")
>  	    (string= (cadr st2) "*"))
> -	(string= (car st1) (car st2))
> -      (string= t1 t2))))
> +	;; Comparison of content types should be case insensitive.
> +	(string= (downcase (car st1)) (downcase (car st2)))
> +      (string= (downcase t1) (downcase t2)))))
>  
>  (defvar notmuch-multipart/alternative-discouraged
>    '(

LGTM.

jamie.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20120326/025634a8/attachment.pgp>


More information about the notmuch mailing list