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)
This commit is contained in:
parent
ea47568b19
commit
b9373ac26a
1 changed files with 6 additions and 1 deletions
|
@ -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) "/" ""))
|
||||
(root
|
||||
(cond
|
||||
;; 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))
|
||||
|
|
Loading…
Add table
Reference in a new issue