diff options
author | Štěpán Němec <stepnem@gmail.com> | 2020-03-07 18:26:44 +0100 |
---|---|---|
committer | Štěpán Němec <stepnem@gmail.com> | 2020-04-13 12:12:00 +0200 |
commit | 188bd80a903d34ef6a85b09e99890433e7adceb7 (patch) | |
tree | f8f32f801fcf61e0a4464bee9319c1ecc78e8943 /lisp/emacs-lisp/bindat.el | |
parent | c395ebaf2142b4a142262353f730fb7b1fcea710 (diff) | |
download | emacs-188bd80a903d34ef6a85b09e99890433e7adceb7.tar.gz emacs-188bd80a903d34ef6a85b09e99890433e7adceb7.tar.bz2 emacs-188bd80a903d34ef6a85b09e99890433e7adceb7.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, reusing existing helper function. (bug#39980)
* lisp/vc/ediff-init.el (ediff-truncate-string-left): Rename to
'string-truncate-left' and move...
* lisp/emacs-lisp/subr-x.el (string-truncate-left): ...here.
All callers changed.
* lisp/gnus/gnus-sum.el (gnus-shorten-url): Fix args-out-of-range
error, don't drop #fragments, use 'string-truncate-left'.
Diffstat (limited to 'lisp/emacs-lisp/bindat.el')
0 files changed, 0 insertions, 0 deletions