From 436d3307211db86d5606e6cec51d6fbe9f7572a8 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 11 Nov 2015 22:01:39 +0200 Subject: [PATCH] Avoid error in submitting a form with EWW * lisp/gnus/mm-url.el (mm-url-form-encode-xwfu): Allow argument CHUNK to be nil. (Bug#21881) --- lisp/gnus/mm-url.el | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/lisp/gnus/mm-url.el b/lisp/gnus/mm-url.el index 6d5f2a34c79..ecc5ac47624 100644 --- a/lisp/gnus/mm-url.el +++ b/lisp/gnus/mm-url.el @@ -392,17 +392,18 @@ spaces. Die Die Die." (if (consp chunk) (setq chunk (cdr chunk))) - (mapconcat - (lambda (char) - (cond - ((= char ? ) "+") - ((memq char mm-url-unreserved-chars) (char-to-string char)) - (t (upcase (format "%%%02x" char))))) - (mm-encode-coding-string chunk - (if (fboundp 'find-coding-systems-string) - (car (find-coding-systems-string chunk)) - buffer-file-coding-system)) - "")) + (if chunk + (mapconcat + (lambda (char) + (cond + ((= char ? ) "+") + ((memq char mm-url-unreserved-chars) (char-to-string char)) + (t (upcase (format "%%%02x" char))))) + (mm-encode-coding-string chunk + (if (fboundp 'find-coding-systems-string) + (car (find-coding-systems-string chunk)) + buffer-file-coding-system)) + ""))) (defun mm-url-encode-www-form-urlencoded (pairs) "Return PAIRS encoded for forms." -- 2.39.5