[PATCH v3 0/1] MR2827: ntdll: Correctly identify hidden files
The code breaks as soon as we try to determine whether a path points to a directory. I suppose the changes will fix the issue. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54939 Signed-off-by: David Kahurani <k.kahurani(a)gmail.com> -- v3: ntdll: Correctly identify hidden files https://gitlab.winehq.org/wine/wine/-/merge_requests/2827
From: David Kahurani <k.kahurani(a)gmail.com> Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54939 Signed-off-by: David Kahurani <k.kahurani(a)gmail.com> --- dlls/ntdll/unix/file.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index 0263d53716b..b1972d678c2 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -1294,19 +1294,19 @@ static BOOLEAN get_dir_case_sensitivity( const char *dir ) * * Check if the specified file should be hidden based on its unix path and the show dot files option. */ -static BOOL is_hidden_file( const char *name ) +static BOOL is_hidden_file( const char *path ) { const char *p; if (show_dot_files) return FALSE; - p = name + strlen( name ); - while (p > name && p[-1] == '/') p--; - while (p > name && p[-1] != '/') p--; + p = path + strlen( path ); + while (p > path && p[-1] == '/') p--; + while (p > path && p[-1] != '/') p--; if (*p++ != '.') return FALSE; if (!*p || *p == '/') return FALSE; /* "." directory */ - if (*p++ != '.') return FALSE; - if (!*p || *p == '/') return FALSE; /* ".." directory */ + if (*p++ == '.' && (!*p || *p == '/')) return FALSE; /* ".." directory */ + return TRUE; } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/2827
On Tue May 16 14:15:18 2023 +0000, David Kahurani wrote:
Interesting indeed, the issue is gone after adjusting the patch to fix the issue with directories. Uhmm... the current issue is that the code reports "dot files" as not being dot files. Same with directories... Let me see about a test.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/2827#note_32896
Looks like a change was made to fix this bug and yes, it doesn't look possible to create a test for this. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/2827#note_33017
This merge request was closed by David Kahurani. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/2827
participants (2)
-
David Kahurani -
David Kahurani (@kahurani)