Commit 3fc36f42 authored by Eli Zaretskii's avatar Eli Zaretskii
Browse files

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)
parent 4b17214a
......@@ -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)));
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment