summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeoff Voelker <voelker@cs.washington.edu>1999-08-06 20:40:36 +0000
committerGeoff Voelker <voelker@cs.washington.edu>1999-08-06 20:40:36 +0000
commitb19cc00c30cb5261225fc0a80e1f7a9dcba13b51 (patch)
treeef545f6ba2603476a1c6f0f6ca2fc701607c2f93
parent4424b2557f0dc7dd6cf89fd73212e6063353bcd3 (diff)
downloademacs-b19cc00c30cb5261225fc0a80e1f7a9dcba13b51.tar.gz
emacs-b19cc00c30cb5261225fc0a80e1f7a9dcba13b51.tar.bz2
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)
/* (This is hacky, but helps when doing file completions on
network drives.) Optimize by using information available from
active readdir if possible. */
+ len = strlen (dir_pathname);
+ if (IS_DIRECTORY_SEP (dir_pathname[len-1]))
+ len--;
if (dir_find_handle != INVALID_HANDLE_VALUE
- && (len = strlen (dir_pathname)),
- strnicmp (name, dir_pathname, len) == 0
+ && strnicmp (name, dir_pathname, len) == 0
&& IS_DIRECTORY_SEP (name[len])
&& stricmp (name + len + 1, dir_static.d_name) == 0)
{