# HG changeset patch # User Geoff Voelker # Date 933972036 0 # Node ID 953155ee541a28e069ae78afe1696ce49330d0d4 # Parent 03f530e858dff9d0de38adcd8e5a74a764f120a4 (stat): Check for directory ending in separator when doing readdir fast path. diff -r 03f530e858df -r 953155ee541a src/w32.c --- a/src/w32.c Fri Aug 06 20:40:10 1999 +0000 +++ b/src/w32.c Fri Aug 06 20:40:36 1999 +0000 @@ -1955,9 +1955,11 @@ /* (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) {