Fixed regexp.
authorueno <ueno>
Mon, 24 Apr 2006 06:47:56 +0000 (06:47 +0000)
committerueno <ueno>
Mon, 24 Apr 2006 06:47:56 +0000 (06:47 +0000)
epg.el

diff --git a/epg.el b/epg.el
index 82de421..2de8b75 100644 (file)
--- 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))))))