Article View: gnu.emacs.vm.bug
Article #988Minor bug and patch for vm-url-decode-buffer [Repost]
From: Pete Forman
Date: Tue, 12 Feb 2002 09:04
Date: Tue, 12 Feb 2002 09:04
45 lines
2545 bytes
2545 bytes
[This is my third attempt at posting, my normal news server is flakey]
vm-url-decode-buffer only recognizes upper case hex digits in escape
codes following a "%". RFCs 1738 and 2396 both allow upper and lower
case.
Here is a patch that remedies the situation. My VM is version 7.00.
*** vm-misc.el.orig Sun Nov 18 20:36:09 2001
--- vm-misc.el Tue Feb 5 10:17:56 2002
***************
*** 852,862 ****
(hex-digit-alist '((?0 . 0) (?1 . 1) (?2 . 2) (?3 . 3)
(?4 . 4) (?5 . 5) (?6 . 6) (?7 . 7)
(?8 . 8) (?9 . 9) (?A . 10) (?B . 11)
! (?C . 12) (?D . 13) (?E . 14) (?F . 15)))
char)
(save-excursion
(goto-char (point-min))
! (while (re-search-forward "%[0-9A-F][0-9A-F]" nil t)
(insert-char (+ (* (cdr (assq (char-after (- (point) 2))
hex-digit-alist))
16)
--- 852,864 ----
(hex-digit-alist '((?0 . 0) (?1 . 1) (?2 . 2) (?3 . 3)
(?4 . 4) (?5 . 5) (?6 . 6) (?7 . 7)
(?8 . 8) (?9 . 9) (?A . 10) (?B . 11)
! (?C . 12) (?D . 13) (?E . 14) (?F . 15)
! (?a . 10) (?b . 11) (?c . 12) (?d . 13)
! (?e . 14) (?f . 15)))
char)
(save-excursion
(goto-char (point-min))
! (while (re-search-forward "%[0-9A-Fa-f][0-9A-Fa-f]" nil t)
(insert-char (+ (* (cdr (assq (char-after (- (point) 2))
hex-digit-alist))
16)
--
Pete Forman -./\.- Disclaimer: This post is originated
WesternGeco -./\.- by myself and does not represent
pete.forman@westerngeco.com -./\.- opinion of Schlumberger, Baker
http://petef.port5.com (new) -./\.- Hughes or their divisions.
Technical Details
Message-ID:
<de538c28.0202120104.1be8d094@posting.google.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f6829,8750cb7ec181fc1f,start X-Google-Attributes: gidf6829,public X-Google-ArrivalTime: 2002-02-12 01:04:11 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mail From: pete.forman@westerngeco.com (Pete Forman) Newsgroups: gnu.emacs.vm.bug Subject: Minor bug and patch for vm-url-decode-buffer [Repost] Date: 12 Feb 2002 01:04:11 -0800 Organization: http://groups.google.com/ Lines: 45 Message-ID: <de538c28.0202120104.1be8d094@posting.google.com> NNTP-Posting-Host: 134.32.6.157 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1013504651 29950 127.0.0.1 (12 Feb 2002 09:04:11 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 12 Feb 2002 09:04:11 GMT