* lisp/files.el (file-name-split): Fix problem with non-absolute
names.
(setq filename (and dir (directory-file-name dir)))
;; If there's nothing left to peel off, we're at the root and
;; we can stop.
- (when (equal dir filename)
+ (when (and dir (equal dir filename))
(push "" components)
(setq filename nil))))
components))
;; `save-some-buffers-default-predicate' (i.e. the 2nd element) is ignored.
(nil save-some-buffers-root ,nb-might-save))))))
-(defun test-file-name-split ()
+(ert-deftest test-file-name-split ()
(should (equal (file-name-split "foo/bar") '("foo" "bar")))
(should (equal (file-name-split "/foo/bar") '("" "foo" "bar")))
(should (equal (file-name-split "/foo/bar/zot") '("" "foo" "bar" "zot")))