From: ueno Date: Mon, 24 Apr 2006 06:47:56 +0000 (+0000) Subject: Fixed regexp. X-Git-Tag: epg-0_0_1~31 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d7c0a64b8d75b5e418f4aaf04fc20995eeb9f968;p=elisp%2Fepg.git Fixed regexp. --- diff --git a/epg.el b/epg.el index 82de421..2de8b75 100644 --- a/epg.el +++ b/epg.el @@ -1487,12 +1487,17 @@ If you are unsure, use synchronous version of this function (defun epg-decode-quotedstring (string) (let ((index 0)) - (while (string-match "\\\\\\(\\([,=+<>#;\\\"]\\)\\|x?\\([0-9A-Fa-f][0-9A-Fa-f]\\)\\)" string index) + (while (string-match "\\\\\\(\\([,=+<>#;\\\"]\\)\\|\ +\\([0-9A-Fa-f][0-9A-Fa-f]\\)\\|\\(.\\)\\)" + string index) (if (match-beginning 2) (setq string (replace-match "\\2" t nil string) index (1+ index)) - (setq string (replace-match "\\x\\3" t nil string) - index (+ index 4)))) + (if (match-beginning 3) + (setq string (replace-match "\\x\\3" t nil string) + index (+ index 4)) + (setq string (replace-match "\\\\\\\\\\4" t nil string) + index (+ index 4))))) (car (read-from-string (concat "\"" string "\""))))) (defun epg-dn-from-string (string) @@ -1516,16 +1521,14 @@ The return value is an alist mapping from types to values." (unless type (error "Invalid type")) (if (eq index (string-match - "\\([^,=+<>#;\\\"]\\|\ -\\\\[,=+<>#;\\\"]\\|\\\\x?[0-9A-Fa-f][0-9A-Fa-f]\\)+" + "\\([^,=+<>#;\\\"]\\|\\\\.\\)+" string index)) (setq index (match-end 0) value (epg-decode-quotedstring (match-string 0 string))) (if (eq index (string-match "#\\([0-9A-Fa-f]+\\)" string index)) (setq index (match-end 0) value (epg-decode-hexstring (match-string 1 string))) - (if (eq index (string-match "\"\\([^\\\"]\\|\ -\\(\\\\[,=+<>#;\\\"]\\|\\\\x?[0-9A-Fa-f][0-9A-Fa-f]\\)\\)*\"" + (if (eq index (string-match "\"\\([^\\\"]\\|\\\\.\\)*\"" string index)) (setq index (match-end 0) value (epg-decode-quotedstring (match-string 0 string))))))