GNU bug report logs - #39980
[PATCH] gnus-shorten-url: Improve and avoid args-out-of-range error

Previous Next

Package: emacs;

Reported by: Štěpán Němec <stepnem <at> gmail.com>

Date: Sun, 8 Mar 2020 09:07:02 UTC

Severity: normal

Tags: patch

Done: Štěpán Němec <stepnem <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Štěpán Němec <stepnem <at> gmail.com>
Cc: 39980 <at> debbugs.gnu.org
Subject: Re: bug#39980: [PATCH] gnus-shorten-url: Improve and avoid
 args-out-of-range error
Date: Sat, 14 Mar 2020 12:41:34 +0100
Štěpán Němec <stepnem <at> gmail.com> writes:

> 'gnus-shorten-url' (used by 'gnus-summary-browse-url') ignored
> fragment identifiers and didn't check substring bounds, in some cases
> leading to runtime errors, e.g.:
>
>   (gnus-shorten-url "https://some.url.with/path/and#also_a_long_target" 40)
>   ;; => Lisp error: (args-out-of-range "/path/and" -18 nil)
>
> This commit makes it account for #fragments and fixes faulty string
> computation, reusing existing helper function.

Looks like a good fix to me, but is there a reason this is a defsubst
instead of a defun?

+(defsubst string-truncate-left (string length)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 5 years and 41 days ago.

Previous Next


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