diff --git a/compat/win32/fscache.c b/compat/win32/fscache.c index d183ee9da1..7427ecb85f 100644 --- a/compat/win32/fscache.c +++ b/compat/win32/fscache.c @@ -251,8 +251,9 @@ static struct fsentry *fsentry_create_list(struct fscache *cache, *dir_not_found = 0; /* convert name to UTF-16 and check length */ - if ((wlen = xutftowcs_path_ex(pattern, dir->name, MAX_LONG_PATH, - dir->len, MAX_PATH - 2, core_long_paths)) < 0) + if ((wlen = xutftowcs_path_ex(pattern, dir->dirent.d_name, + MAX_LONG_PATH, dir->len, MAX_PATH - 2, + core_long_paths)) < 0) return NULL; /* handle CWD */