Commit b9373ac2 authored by Eli Zaretskii's avatar Eli Zaretskii
Browse files

Fix file-in-directory-p when the directory is UNC

* lisp/files.el (file-in-directory-p): Support files and
directories that begin with "//".  (Bug#20844)
parent ea47568b
......@@ -5279,7 +5279,12 @@ Return nil if DIR is not an existing directory."
dir (file-truename dir))
(let ((ls1 (split-string file "/" t))
(ls2 (split-string dir "/" t))
(root (if (string-match "\\`/" file) "/" ""))
;; A UNC on Windows systems, or a "super-root" on Apollo.
((string-match "\\`//" file) "//")
((string-match "\\`/" file) "/")
(t "")))
(mismatch nil))
(while (and ls1 ls2 (not mismatch))
(if (string-equal (car ls1) (car ls2))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment