GNU bug report logs - #78690
31.0.50; split string: args out of range with TRIM

Previous Next

Package: emacs;

Reported by: Michael Heerdegen <michael_heerdegen <at> web.de>

Date: Wed, 4 Jun 2025 02:35:02 UTC

Severity: normal

Found in version 31.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 78690 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 78690 <at> debbugs.gnu.org
Subject: Re: bug#78690: 31.0.50; split string: args out of range with TRIM
Date: Fri, 06 Jun 2025 03:53:47 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

> It is quite obvious that split-string is not prepared to deal with a
> situation where the argument STRING begins with a match for
> SEPARATORS.  The breakage here happens because the match for
> SEPARATORS at the very beginning of STRING also matches TRIM, but even
> if that is not so, a match for SEPARATORS at the beginning of STRING
> sets THIS-START incorrectly for the first call to push-one inside the
> while-loop.

I read that as "confirmed, a bug".  Ok, thanks for the analysis.

The original use case is in Helm btw, which does a call like this.  I
made the example a bit shorter for this report - in the original issue
the string starts with whitespace, like

  "            -*- lexical-binding: t; -*-"

but as you already mentioned the issue is the same.


Michael.




This bug report was last modified 21 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.