From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/54820 Path: main.gmane.org!not-for-mail From: Simon Josefsson Newsgroups: gmane.emacs.gnus.general Subject: Re: gnus: pgg-gpg-lookup-key uses wrong regular expression Date: Sat, 15 Nov 2003 01:50:36 +0100 Sender: ding-owner@lists.math.uh.edu Message-ID: References: <87oevfug08.fsf@glaurung.green-gryphon.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1068857515 13627 80.91.224.253 (15 Nov 2003 00:51:55 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 15 Nov 2003 00:51:55 +0000 (UTC) Cc: ultrasoul@ultrasoul.com (David D. Smith), 220521-forwarded@bugs.debian.org, ding@gnus.org Original-X-From: ding-owner+M3360@lists.math.uh.edu Sat Nov 15 01:51:51 2003 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AKofH-00026n-00 for ; Sat, 15 Nov 2003 01:51:51 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1AKoeX-0002tW-00; Fri, 14 Nov 2003 18:51:05 -0600 Original-Received: from justine.libertine.org ([66.139.78.221] ident=postfix) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1AKoeO-0002tO-00 for ding@lists.math.uh.edu; Fri, 14 Nov 2003 18:50:56 -0600 Original-Received: from yxa.extundo.com (178.230.13.217.in-addr.dgcsystems.net [217.13.230.178]) by justine.libertine.org (Postfix) with ESMTP id E9BCF3A0027; Fri, 14 Nov 2003 18:50:52 -0600 (CST) Original-Received: from latte (yxa.extundo.com [217.13.230.178]) (authenticated bits=0) by yxa.extundo.com (8.12.10/8.12.10) with ESMTP id hAF0oi1K000635; Sat, 15 Nov 2003 01:50:46 +0100 Original-To: bugs@gnus.org (The Gnus Bugfixing Girls + Boys) Mail-Copies-To: nobody X-Payment: hashcash 1.2 0:031115:bugs@gnus.org:6b8ad7e41b251ec6 X-Hashcash: 0:031115:bugs@gnus.org:6b8ad7e41b251ec6 X-Payment: hashcash 1.2 0:031115:ultrasoul@ultrasoul.com:f766ebe640674b27 X-Hashcash: 0:031115:ultrasoul@ultrasoul.com:f766ebe640674b27 X-Payment: hashcash 1.2 0:031115:220521-forwarded@bugs.debian.org:d48dc6285404e593 X-Hashcash: 0:031115:220521-forwarded@bugs.debian.org:d48dc6285404e593 X-Payment: hashcash 1.2 0:031115:ding@gnus.org:4b9438ba265529f6 X-Hashcash: 0:031115:ding@gnus.org:4b9438ba265529f6 In-Reply-To: <87oevfug08.fsf@glaurung.green-gryphon.com> (Manoj Srivastava's message of "Fri, 14 Nov 2003 09:27:51 -0600") User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux) Precedence: bulk Xref: main.gmane.org gmane.emacs.gnus.general:54820 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:54820 Let me know if this works or not. Apparently, the behaviour of the new split-string was intentional, so it is no longer possible to use the function portably... Well, it was useful while it lasted. 2003-11-15 Simon Josefsson * 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). --- pgg-gpg.el.~6.21.~ 2003-11-09 22:36:49.000000000 +0100 +++ pgg-gpg.el 2003-11-15 01:43:13.000000000 +0100 @@ -114,12 +114,9 @@ (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) @@ -131,12 +128,9 @@ (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.