Changes committed gnus/lisp (ChangeLog rfc2231.el)

"Katsumi Yamaoka" <[email protected]>
Newsgroups gmane.emacs.gnus.commits
Message-ID <[email protected]>
Modified: ChangeLog rfc2231.el

(rfc2231-decode-encoded-string): Don't decode things that are not 2-digit
 hexadecimal characters that follow `%'s.


Index: ChangeLog
diff -u gnus/lisp/ChangeLog:7.1868 gnus/lisp/ChangeLog:7.1869
--- ChangeLog:7.1868	Thu May 29 20:16:58 2008
+++ ChangeLog	Fri May 30 12:06:47 2008
@@ -1,3 +1,8 @@
+2008-05-30  Katsumi Yamaoka  <[email protected]>
+
+	* rfc2231.el (rfc2231-decode-encoded-string): Don't decode things that
+	are not 2-digit hexadecimal characters that follow `%'s.
+
 2008-05-29  Reiner Steib  <[email protected]>
 
 	* message.el (message-bogus-recipient-p): Fix type in doc string.
Index: rfc2231.el
diff -u gnus/lisp/rfc2231.el:7.26 gnus/lisp/rfc2231.el:7.27
--- rfc2231.el:7.26	Mon May 19 10:47:42 2008
+++ rfc2231.el	Fri May 30 12:06:47 2008
@@ -214,11 +214,11 @@
     (mm-with-unibyte-buffer
       (insert value)
       (goto-char (point-min))
-      (while (search-forward "%" nil t)
+      (while (re-search-forward "%\\([0-9A-Fa-f][0-9A-Fa-f]\\)" nil t)
 	(insert
 	 (prog1
-	     (string-to-number (buffer-substring (point) (+ (point) 2)) 16)
-	   (delete-region (1- (point)) (+ (point) 2)))))
+	     (string-to-number (match-string 1) 16)
+	   (delete-region (match-beginning 0) (match-end 0)))))
       ;; Decode using the charset, if any.
       (if (memq coding-system '(nil ascii))
 	  (buffer-string)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.