summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2017-08-25 17:43:15 +0300
committerEli Zaretskii <eliz@gnu.org>2017-08-25 17:43:15 +0300
commit0d2b4093984f0927b4fb07de971bd7e077fee93c (patch)
treee9b2566025415a70353c27da07e6bb5c9d56d1cb /src
parent690512d2af16370097cf646764e86caf8a27eade (diff)
downloademacs-0d2b4093984f0927b4fb07de971bd7e077fee93c.tar.gz
emacs-0d2b4093984f0927b4fb07de971bd7e077fee93c.tar.bz2
emacs-0d2b4093984f0927b4fb07de971bd7e077fee93c.zip
Fix file-name completion on network shares
* src/w32.c (faccessat): Don't assume that F_OK is non-zero. (Bug#28207)
Diffstat (limited to 'src')
-rw-r--r--src/w32.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/w32.c b/src/w32.c
index a4be017d8ed..c989af6a46a 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -3908,7 +3908,9 @@ faccessat (int dirfd, const char * path, int mode, int flags)
path = fullname;
}
- if (IS_DIRECTORY_SEP (path[strlen (path) - 1]) && (mode & F_OK) != 0)
+ /* When dired.c calls us with F_OK and a trailing slash, it actually
+ wants to know whether PATH is a directory. */
+ if (IS_DIRECTORY_SEP (path[strlen (path) - 1]) && ((mode & F_OK) == F_OK))
mode |= D_OK;
/* MSVCRT implementation of 'access' doesn't recognize D_OK, and its