aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeoff Voelker1999-08-06 20:40:36 +0000
committerGeoff Voelker1999-08-06 20:40:36 +0000
commitb19cc00c30cb5261225fc0a80e1f7a9dcba13b51 (patch)
treeef545f6ba2603476a1c6f0f6ca2fc701607c2f93
parent4424b2557f0dc7dd6cf89fd73212e6063353bcd3 (diff)
downloademacs-b19cc00c30cb5261225fc0a80e1f7a9dcba13b51.tar.gz
emacs-b19cc00c30cb5261225fc0a80e1f7a9dcba13b51.zip
(stat): Check for directory ending in separator when
doing readdir fast path.
-rw-r--r--src/w32.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/w32.c b/src/w32.c
index bac1425802c..7a9f8660820 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -1955,9 +1955,11 @@ stat (const char * path, struct stat * buf)
1955 /* (This is hacky, but helps when doing file completions on 1955 /* (This is hacky, but helps when doing file completions on
1956 network drives.) Optimize by using information available from 1956 network drives.) Optimize by using information available from
1957 active readdir if possible. */ 1957 active readdir if possible. */
1958 len = strlen (dir_pathname);
1959 if (IS_DIRECTORY_SEP (dir_pathname[len-1]))
1960 len--;
1958 if (dir_find_handle != INVALID_HANDLE_VALUE 1961 if (dir_find_handle != INVALID_HANDLE_VALUE
1959 && (len = strlen (dir_pathname)), 1962 && strnicmp (name, dir_pathname, len) == 0
1960 strnicmp (name, dir_pathname, len) == 0
1961 && IS_DIRECTORY_SEP (name[len]) 1963 && IS_DIRECTORY_SEP (name[len])
1962 && stricmp (name + len + 1, dir_static.d_name) == 0) 1964 && stricmp (name + len + 1, dir_static.d_name) == 0)
1963 { 1965 {