From: Lars Ingebrigtsen Date: Sat, 13 Feb 2016 03:31:53 +0000 (+1100) Subject: Fix encoding problem introduced by previous patch series X-Git-Tag: emacs-26.0.90~2599 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=46ef01fc88964d7283b923354f4ba814d98e80a0;p=emacs.git Fix encoding problem introduced by previous patch series * lisp/gnus/rfc2047.el: Ditto (bug#22648). * lisp/gnus/rfc2231.el: Fix problem created by the mm-replace-in-string conversion. --- diff --git a/lisp/gnus/mml-sec.el b/lisp/gnus/mml-sec.el index e23fb1a27f2..b4417507b8a 100644 --- a/lisp/gnus/mml-sec.el +++ b/lisp/gnus/mml-sec.el @@ -949,8 +949,8 @@ If no one is selected, symmetric encryption will be performed. " (if (eq 'OpenPGP protocol) (epg-sign-string context (buffer-string) mode) (epg-sign-string context - (replace-regexp-in-string (buffer-string) - "\n" "\r\n") + (replace-regexp-in-string + "\n" "\r\n" (buffer-string)) t)) mml-secure-secret-key-id-list nil) (error diff --git a/lisp/gnus/mml-smime.el b/lisp/gnus/mml-smime.el index e7ee6e7c889..f7cf71adf62 100644 --- a/lisp/gnus/mml-smime.el +++ b/lisp/gnus/mml-smime.el @@ -424,7 +424,7 @@ Content-Disposition: attachment; filename=smime.p7m (mm-set-handle-multipart-parameter mm-security-handle 'gnus-info "Corrupted") (throw 'error handle)) - (setq part (replace-regexp-in-string part "\n" "\r\n") + (setq part (replace-regexp-in-string "\n" "\r\n" part) context (epg-make-context 'CMS)) (condition-case error (setq plain (epg-verify-string context (mm-get-part signature) part)) diff --git a/lisp/gnus/mml2015.el b/lisp/gnus/mml2015.el index ca9b3777c35..309f1a77ff0 100644 --- a/lisp/gnus/mml2015.el +++ b/lisp/gnus/mml2015.el @@ -926,7 +926,7 @@ If set, it overrides the setting of `mml2015-sign-with-sender'." (mm-set-handle-multipart-parameter mm-security-handle 'gnus-info "Corrupted") (throw 'error handle)) - (setq part (replace-regexp-in-string part "\n" "\r\n") + (setq part (replace-regexp-in-string "\n" "\r\n" part) signature (mm-get-part signature) context (epg-make-context)) (condition-case error diff --git a/lisp/gnus/rfc2047.el b/lisp/gnus/rfc2047.el index 2862bb3a810..b05dfc1e109 100644 --- a/lisp/gnus/rfc2047.el +++ b/lisp/gnus/rfc2047.el @@ -554,7 +554,7 @@ Dynamically bind `rfc2047-encoding-type' to change that." (if (or debug-on-quit debug-on-error) (signal (car err) (cdr err)) (error "Invalid data for rfc2047 encoding: %s" - (replace-regexp-in-string orig-text "[ \t\n]+" " ")))))))) + (replace-regexp-in-string "[ \t\n]+" " " orig-text)))))))) (unless dont-fold (rfc2047-fold-region b (point))) (goto-char (point-max)))) @@ -699,8 +699,8 @@ Point moves to the end of the region." (setq eword (rfc2047-encode-1 (- b (point-at-bol)) (replace-regexp-in-string - (buffer-substring-no-properties b e) - "\n\\([ \t]?\\)" "\\1") + "\n\\([ \t]?\\)" "\\1" + (buffer-substring-no-properties b e)) cs (or (cdr (assq encoding rfc2047-encode-function-alist)) diff --git a/lisp/gnus/rfc2231.el b/lisp/gnus/rfc2231.el index f5f0c818294..128779ab4c6 100644 --- a/lisp/gnus/rfc2231.el +++ b/lisp/gnus/rfc2231.el @@ -63,13 +63,13 @@ must never cause a Lisp error." (let (mod) (when (and (string-match "\\\\\"" string) (not (string-match "\\`\"\\|[^\\]\"" string))) - (setq string (replace-regexp-in-string string "\\\\\"" "\"") + (setq string (replace-regexp-in-string "\\\\\"" "\"" string) mod t)) (when (and (string-match "\\\\(" string) (string-match "\\\\)" string) (not (string-match "\\`(\\|[^\\][()]" string))) - (setq string (replace-regexp-in-string string - "\\\\\\([()]\\)" "\\1") + (setq string (replace-regexp-in-string + "\\\\\\([()]\\)" "\\1" string) mod t)) (or (and mod (ignore-errors