diff options
author | Štěpán Němec <stepnem@gmail.com> | 2020-04-12 19:57:59 +0200 |
---|---|---|
committer | Štěpán Němec <stepnem@gmail.com> | 2020-04-13 12:03:38 +0200 |
commit | 81d07da788e7caea266f4a520cd9922c990d04e9 (patch) | |
tree | 47305fdb2e8b01ecea49a5f35e058ec7becfd090 /lisp/emacs-lisp/backtrace.el | |
parent | 1dfc497fac22c199a944ef64233266bd6cd2fee6 (diff) | |
download | emacs-81d07da788e7caea266f4a520cd9922c990d04e9.tar.gz emacs-81d07da788e7caea266f4a520cd9922c990d04e9.tar.bz2 emacs-81d07da788e7caea266f4a520cd9922c990d04e9.zip |
gnus-shorten-url: Improve and avoid args-out-of-range error
'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. (bug#39980)
Do not merge to master, where the helper is put to subr-x.el.
* lisp/gnus/gnus-sum.el (gnus--string-truncate-left): New helper
function (copied from 'ediff-truncate-string-left').
(gnus-shorten-url): Use it and don't drop #fragments.
Diffstat (limited to 'lisp/emacs-lisp/backtrace.el')
0 files changed, 0 insertions, 0 deletions