diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2020-12-21 20:42:17 +0100 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2020-12-21 20:42:17 +0100 |
commit | fd9431dde443471f17ffeebf9628fd9aee154e1b (patch) | |
tree | afe8067415dde3f1c96c91ff5e12cf947e7c3825 /lisp/emacs-lisp/subr-x.el | |
parent | cf2e8321850f81d9eb0ebc23a4887f12dc3dbfac (diff) | |
download | emacs-fd9431dde443471f17ffeebf9628fd9aee154e1b.tar.gz emacs-fd9431dde443471f17ffeebf9628fd9aee154e1b.tar.bz2 emacs-fd9431dde443471f17ffeebf9628fd9aee154e1b.zip |
Fix shorter-than-length case for string-limit
* lisp/emacs-lisp/subr-x.el (string-limit): Fix
shorter-than-length case.
Diffstat (limited to 'lisp/emacs-lisp/subr-x.el')
-rw-r--r-- | lisp/emacs-lisp/subr-x.el | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el index db7e75dfd2b..05fa16da499 100644 --- a/lisp/emacs-lisp/subr-x.el +++ b/lisp/emacs-lisp/subr-x.el @@ -292,7 +292,7 @@ is a positive number, return a a substring consisting of the first LENGTH characters of STRING. If LENGTH is negative, return a substring consisitng of thelast LENGTH characters of STRING." (cond - ((<= (length string) length) string) + ((<= (length string) (abs length)) string) ((>= length 0) (substring string 0 length)) (t (substring string (+ (length string) length))))) |