On Mon, Oct 19, 2026 at 05:59:55PM +0100, Gavin Smith wrote:
> On Mon, Oct 19, 2026 at 04:15:43PM +0800, aidan wrote:
> > 1. create a file named "infokey":
> > 
> > #info
> > 
> > \ j    move-to-next-xref
> > \ k    move-to-prev-xref
> > 
> > 2. env -u INFOPATH info --init-file ./infokey
> > 3. press `SPC C-g`, the echo area displays "Unknown command (SPC C-g)"
> > 4. press `SPC` and wait, the echo area displays "SPC-C-g", but should be 
> > "SPC-"
> 
> Thanks for the report.  This should be fixed in commit 931e60ffd1 (today's
> date).

I'm having some difficulty pushing the commit - "git push" seems to freeze.

Here is the fix for reference.  I will push this when I can.

diff --git a/ChangeLog b/ChangeLog
index 0e750ba714..df68b34e88 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2026-10-19  Gavin Smith <[email protected]>
+
+       Fix junk at end of printed key sequence.
+
+       * info/util.c (text_buffer_add_string): Always null terminate output
+       buffer.
+       
+       When printing a key sequence in the echo area, junk left over from
+       a previous key sequence could be displayed due to this function being
+       used.
+
+       Report from Aidan <[email protected]>.
+
 2026-10-19  Gavin Smith <[email protected]>
 
        Fix "M-x describe-key RET C-x 2"
diff --git a/info/util.c b/info/util.c
index 9fd9ffd62d..1ae5635f88 100644
--- a/info/util.c
+++ b/info/util.c
@@ -215,6 +215,7 @@ text_buffer_add_string (struct text_buffer *buf, const char 
*str, size_t len)
   text_buffer_alloc (buf, len);
   memcpy (buf->base + buf->off, str, len);
   buf->off += len;
+  buf->base[buf->off] = '\0';
   return len;
 }
 


Reply via email to