Fix make-temp-file bug with ""/"."/".." prefix
commitebf53ed4f6469d24c3a76835eab014d82aed551c
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 13 Aug 2017 03:04:43 +0000 (12 20:04 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 13 Aug 2017 03:05:23 +0000 (12 20:05 -0700)
tree6a5f10abdc9c59f02910cde7e5f4e479d4835d1d
parenta6ad98ad66e1d0c0dac5f25ba91e11d0cf9da725
Fix make-temp-file bug with ""/"."/".." prefix

The bug with "." and ".." has been present for a while; I
introduced the bug with "" earlier today in my patch for Bug#28023.
* lisp/files.el (make-temp-file): Do not use expand-file-name if
PREFIX is empty or "." or "..", as it does the wrong thing.
Compute absolute-prefix here ...
(files--make-magic-temp-file): ... instead of here ...
* src/fileio.c (Fmake_temp_file_internal): ... or here.

* lisp/files.el (make-temp-file): If the prefix is empty, append
"/" to the absolute prefix so that the new files are children
rather than siblings of temporary-file-directory.  This fixes a
bug introduced in the previous change.
* test/lisp/files-tests.el (files-test-make-temp-file-empty-prefix):
New test, for the bug.
lisp/files.el
src/fileio.c
test/lisp/files-tests.el