From: Eli Zaretskii Date: Sat, 27 May 2017 12:57:38 +0000 (+0300) Subject: Avoid args-out-of-range errors on fringe clicks after "C-h k" X-Git-Tag: emacs-26.0.90~521^2~255 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3fc36f427a6dfe5366fd1391fee1d037a1bd6cd7;p=emacs.git Avoid args-out-of-range errors on fringe clicks after "C-h k" * src/keyboard.c (echo_truncate): Don't call Ftruncate if the echo message is already shorter than NCHARS. (Bug#27040) --- diff --git a/src/keyboard.c b/src/keyboard.c index c9fa2a9f5e1..55486c6d9ab 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -634,7 +634,8 @@ echo_length (void) static void echo_truncate (ptrdiff_t nchars) { - if (STRINGP (KVAR (current_kboard, echo_string))) + Lisp_Object es = KVAR (current_kboard, echo_string); + if (STRINGP (es) && SCHARS (es) > nchars) kset_echo_string (current_kboard, Fsubstring (KVAR (current_kboard, echo_string), make_number (0), make_number (nchars)));