Commit 4d9e34e0 authored by Paul Eggert's avatar Paul Eggert
Browse files

Fix the buffer-count patch (Bug#23394)

* src/buffer.c (Fgenerate_new_buffer_name): Increment count just
once each time through the loop.  Reported by Lars Ingebrigtsen in:
parent 2b4c0998
......@@ -1073,11 +1073,11 @@ is first appended to NAME, to speed up finding a non-existent buffer. */)
return genbase;
for (ptrdiff_t count = 1; ; count++)
for (ptrdiff_t count = 2; ; count++)
char number[INT_BUFSIZE_BOUND (ptrdiff_t) + sizeof "<>"];
AUTO_STRING_WITH_LEN (lnumber, number,
sprintf (number, "<%"pD"d>", ++count));
sprintf (number, "<%"pD"d>", count));
Lisp_Object gentemp = concat2 (genbase, lnumber);
if (!NILP (Fstring_equal (gentemp, ignore))
|| NILP (Fget_buffer (gentemp)))
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