diff options
author | Eli Zaretskii <eliz@gnu.org> | 2017-08-05 12:52:55 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2017-08-05 12:52:55 +0300 |
commit | 885c512603f946dfb7a45c181e94b8677be2678d (patch) | |
tree | 57ff1799f61273b551668dc1bf3f5f3c9fef1b48 /src/buffer.c | |
parent | 2cb9805702a4f15ca7ee4ef4edb6e6048b1d3320 (diff) | |
download | emacs-885c512603f946dfb7a45c181e94b8677be2678d.tar.gz |
Fix a bug in 'generate-new-buffer-name'
* src/buffer.c (Fgenerate_new_buffer_name): Test IGNORE for being
nil before calling string-equal, since the latter will compare
"nil and 'nil' as equal. (Bug#27966)
* test/src/buffer-tests.el
(test-generate-new-buffer-name-bug27966): New test.
Diffstat (limited to 'src/buffer.c')
-rw-r--r-- | src/buffer.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/buffer.c b/src/buffer.c index 649ddbe1839..0d0f43e937b 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -1077,7 +1077,8 @@ is first appended to NAME, to speed up finding a non-existent buffer. */) CHECK_STRING (name); - if (!NILP (Fstring_equal (name, ignore)) || NILP (Fget_buffer (name))) + if ((!NILP (ignore) && !NILP (Fstring_equal (name, ignore))) + || NILP (Fget_buffer (name))) return name; if (SREF (name, 0) != ' ') /* See bug#1229. */ |