From: Torge Matthies <tmatthies(a)codeweavers.com> Signed-off-by: Torge Matthies <tmatthies(a)codeweavers.com> --- dlls/ntdll/unix/file.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index 957d9f3b801..89eaf859dd1 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -1303,7 +1303,7 @@ static BOOL is_hidden_file( const UNICODE_STRING *name ) end = p = name->Buffer + name->Length/sizeof(WCHAR); while (p > name->Buffer && p[-1] == '\\') p--; while (p > name->Buffer && p[-1] != '\\') p--; - return (p < end && *p == '.'); + return (p < end && p + 1 != end && p[0] == '.' && p[1] != '\\' && (p[1] != '.' || (p + 2 != end && p[2] != '\\'))); } @@ -2224,6 +2224,7 @@ static NTSTATUS get_dir_data_entry( struct dir_data *dir_data, void *info_ptr, I union file_directory_info *info; struct stat st; ULONG name_len, start, dir_size, attributes; + UNICODE_STRING name; if (get_file_info( names->unix_name, &st, &attributes ) == -1) { @@ -2253,8 +2254,8 @@ static NTSTATUS get_dir_data_entry( struct dir_data *dir_data, void *info_ptr, I { if (st.st_dev != dir_data->id.dev) st.st_ino = 0; /* ignore inode if on a different device */ - if (!show_dot_files && names->long_name[0] == '.' && names->long_name[1] && - (names->long_name[1] != '.' || names->long_name[2])) + RtlInitUnicodeString( &name, names->long_name ); + if (is_hidden_file( &name )) attributes |= FILE_ATTRIBUTE_HIDDEN; fill_file_info( &st, attributes, info, class ); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/1148