From: Ted Zlatanov Date: Sat, 19 Aug 2017 02:07:36 +0000 (-0400) Subject: * lisp/files.el (make-temp-file): Fix directory use case. X-Git-Tag: emacs-26.0.90~417 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=fe87e356124494b8450d12f1c23f3fb08bbf7b06;p=emacs.git * lisp/files.el (make-temp-file): Fix directory use case. --- diff --git a/lisp/files.el b/lisp/files.el index af5d3ba53e1..a2b474f8d2b 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -1419,7 +1419,8 @@ If SUFFIX is non-nil, add that at the end of the file name." (files--make-magic-temp-file absolute-prefix dir-flag suffix contents) (let ((file (make-temp-file-internal absolute-prefix (if dir-flag t) (or suffix "")))) - (write-region contents nil file nil 'silent) + (when (and (stringp text) (not dir-flag)) + (write-region contents nil file nil 'silent)) file)))) (defun files--make-magic-temp-file (absolute-prefix