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@gmail.com
-- v3: ntdll: Correctly identify hidden files
From: David Kahurani k.kahurani@gmail.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54939 Signed-off-by: David Kahurani k.kahurani@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; }
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.
Looks like a change was made to fix this bug and yes, it doesn't look possible to create a test for this.
This merge request was closed by David Kahurani.