From: Geoff Voelker Date: Fri, 6 Aug 1999 20:40:36 +0000 (+0000) Subject: (stat): Check for directory ending in separator when X-Git-Tag: emacs-pretest-21.0.90~7248 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b19cc00c30cb5261225fc0a80e1f7a9dcba13b51;p=emacs.git (stat): Check for directory ending in separator when doing readdir fast path. --- 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) {