* 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.
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. */
(should (eq buf (current-buffer))))
(when msg-ov (delete-overlay msg-ov))))))
+(ert-deftest test-generate-new-buffer-name-bug27966 ()
+ (should-not (string-equal "nil"
+ (progn (get-buffer-create "nil")
+ (generate-new-buffer-name "nil")))))
+
;;; buffer-tests.el ends here