(pgg-gpg-lookup-all-secret-keys)
authorSimon Josefsson <jas@extundo.com>
Thu, 8 Jan 2004 13:00:31 +0000 (13:00 +0000)
committerSimon Josefsson <jas@extundo.com>
Thu, 8 Jan 2004 13:00:31 +0000 (13:00 +0000)
(pgg-gpg-lookup-key): Use regexp match instead of
split-string (split-string is different between emacs 21.2 and
21.4).  Reported by ultrasoul@ultrasoul.com (David D. Smith).

lisp/ChangeLog
lisp/pgg-gpg.el

index f606aaa..771376b 100644 (file)
@@ -1,3 +1,10 @@
+2003-11-15  Simon Josefsson  <jas@extundo.com>
+
+       * pgg-gpg.el (pgg-gpg-lookup-all-secret-keys)
+       (pgg-gpg-lookup-key): Use regexp match instead of
+       split-string (split-string is different between emacs 21.2 and
+       21.4).  Reported by ultrasoul@ultrasoul.com (David D. Smith).
+
 2004-01-08  Jesper Harder  <harder@ifa.au.dk>
 
        * gnus-art.el (gnus-mime-view-all-parts)
index 94c1b3a..d453abf 100644 (file)
@@ -1,6 +1,6 @@
 ;;; pgg-gpg.el --- GnuPG support for PGG.
 
-;; Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc.
+;; Copyright (C) 1999, 2000, 2003, 2004 Free Software Foundation, Inc.
 
 ;; Author: Daiki Ueno <ueno@unixuser.org>
 ;; Created: 1999/10/28
       (with-temp-buffer
        (apply #'call-process pgg-gpg-program nil t nil args)
        (goto-char (point-min))
-       (while (re-search-forward "^\\(sec\\|pub\\):"  nil t)
-         (push (substring
-                (nth 3 (split-string
-                        (buffer-substring (match-end 0)
-                                          (progn (end-of-line) (point)))
-                        ":")) 8)
+       (while (re-search-forward
+               "^\\(sec\\|pub\\):[^:]*:[^:]*:[^:]*:\\([^:]*\\)" nil t)
+         (push (substring (match-string 2) 8)
                pgg-gpg-all-secret-keys)))))
   pgg-gpg-all-secret-keys)
 
     (with-temp-buffer
       (apply #'call-process pgg-gpg-program nil t nil args)
       (goto-char (point-min))
-      (if (re-search-forward "^\\(sec\\|pub\\):"  nil t)
-         (substring
-          (nth 3 (split-string
-                  (buffer-substring (match-end 0)
-                                    (progn (end-of-line)(point)))
-                  ":")) 8)))))
+      (if (re-search-forward "^\\(sec\\|pub\\):[^:]*:[^:]*:[^:]*:\\([^:]*\\)"
+                            nil t)
+         (substring (match-string 2) 8)))))
 
 (defun pgg-gpg-encrypt-region (start end recipients &optional sign)
   "Encrypt the current region between START and END.