Gnus development mailing list
 help / color / mirror / Atom feed
From: Simon Josefsson <jas@extundo.com>
Cc: ultrasoul@ultrasoul.com (David D. Smith),
	220521-forwarded@bugs.debian.org, ding@gnus.org
Subject: Re: gnus: pgg-gpg-lookup-key uses wrong regular expression
Date: Fri, 14 Nov 2003 23:13:42 +0100	[thread overview]
Message-ID: <ilufzgqtx7t.fsf@latte.josefsson.org> (raw)
In-Reply-To: <87oevfug08.fsf@glaurung.green-gryphon.com> (Manoj Srivastava's message of "Fri, 14 Nov 2003 09:27:51 -0600")

Manoj Srivastava <srivasta@debian.org> writes:

> Gnus v5.10.2
> GNU Emacs 21.3.1 (i386-pc-linux-gnu, X toolkit)
>  of 2003-10-31 on raven, modified by Debian
>
> Hi,
>
>       [Please retain the CC to 220521-forwarded@bugs.debian.org, so
>       that the Debian BTS has a record of your contribution]
>
> 	This was reported by a Debian user.
>
> In pgg-gpg-kookup-key (line 113 of pgg-gpg.el), that re-search-forward
> call places point at the end of "^\\(sec\\|pub\\):" Next, it splits
> that string at point on ":" separation. The problem is that if the
> string looks like this:
>
> "sec::foo:bar", split string returns '("foo" "bar"), not what the code
> actually expects it to return, '("" "foo" "bar"). The code wants to
> extract the third element of that list return from the split which is
> now unpredictable. This bug was provoked because when I'm signing, it
> parses a string like the one given, but when I'm verifying, it parses
> a string like "pub:u:foo:bar" which returns '("u" "foo" "bar") and the
> third element of that list is indeed what we want.
>
> From the documentation of the split-string function, "If there is
> match for SEPARATORS at the beginning of STRING, we do not include a
> null substring for that.  Likewise, if there is a match at the end of
> STRING, we don't include a null substring for that.
>
> Changing the regular expression to not include the first colon, so
> "^\\(sec\\|pub\\)" produces the proper result every time. Another
> option may be to search forward to the point found by the original
> regular expression and back up one place, so we know every time that
> the string to be split will begin with a separator.

The `split-string in Emacs CVS subr.el contain the following change
that fixes the problem.  As this changes the behaviour of
`split-string', there should be a NEWS entry about it, which there
isn't.  Trying the various examples in the Elisp manual also doesn't
return the same values.  I'll forward this to emacs-devel@gnu.org,
then we can find out whether the right solution is to fix Debian's
Emacs or fix Emacs CVS and Gnus.

	* subr.el (split-string): Implement specification that splitting on
	explicit separators retains null fields.  Add new argument
	OMIT-NULLS.  Special-case (split-string "a string").




  reply	other threads:[~2003-11-14 22:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-14 15:27 Manoj Srivastava
2003-11-14 22:13 ` Simon Josefsson [this message]
2003-11-15  0:50 ` Simon Josefsson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ilufzgqtx7t.fsf@latte.josefsson.org \
    --to=jas@extundo.com \
    --cc=220521-forwarded@bugs.debian.org \
    --cc=ding@gnus.org \
    --cc=ultrasoul@ultrasoul.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).