aboutsummaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
authorKen Brown2019-07-08 18:37:33 -0400
committerKen Brown2019-07-08 18:37:33 -0400
commit0528a7c8725c7c28a6f2815802fcc089c2fe306f (patch)
tree7becae40b631d84dc3676ff6dd4f7dbe73bce5af /test/src
parent122198d2f1aaf0b74c102874cc9b04ae4789f54f (diff)
downloademacs-0528a7c8725c7c28a6f2815802fcc089c2fe306f.tar.gz
emacs-0528a7c8725c7c28a6f2815802fcc089c2fe306f.zip
Ensure that expand-file-name returns an absolute file name
* src/fileio.c (Fexpand_file_name): Don't directly use the current buffer's default-directory if it is relative. Instead replace it by its expansion relative to invocation-directory. (Bug#36502) * test/src/fileio-tests.el (fileio-tests--relative-default-directory): New test.
Diffstat (limited to 'test/src')
-rw-r--r--test/src/fileio-tests.el5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/src/fileio-tests.el b/test/src/fileio-tests.el
index bd827e5498f..8788c830c94 100644
--- a/test/src/fileio-tests.el
+++ b/test/src/fileio-tests.el
@@ -126,3 +126,8 @@ Also check that an encoding error can appear in a symlink."
126 (should (equal c1 (char-before))) 126 (should (equal c1 (char-before)))
127 (should (equal c1 (char-after)))))) 127 (should (equal c1 (char-after))))))
128 (if f (delete-file f))))) 128 (if f (delete-file f)))))
129
130(ert-deftest fileio-tests--relative-default-directory ()
131 "Test expand-file-name when default-directory is relative."
132 (let ((default-directory "some/relative/name"))
133 (should (file-name-absolute-p (expand-file-name "foo")))))