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
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 | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index 0263d53716b..c52611af898 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -1294,19 +1294,21 @@ 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; + struct stat st;
if (show_dot_files) return FALSE;
- p = name + strlen( name ); - while (p > name && p[-1] == '/') p--; - while (p > name && p[-1] != '/') p--; - if (*p++ != '.') return FALSE; - if (!*p || *p == '/') return FALSE; /* "." directory */ - if (*p++ != '.') return FALSE; - if (!*p || *p == '/') return FALSE; /* ".." directory */ + if (stat(path, &st) || S_ISDIR(st.st_mode)) + return FALSE; + + p = path + strlen( path ); + while (p > path && p[-1] == '/') p--; + while (p > path && p[-1] != '/') p--; + if (*p != '.') return FALSE; + return TRUE; }
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=132716
Your paranoid android.
=== debian11 (32 bit report) ===
ntdll: file.c:4097: Test failed: got attributes 0x22
=== debian11 (32 bit zh:CN report) ===
ntdll: file.c:4097: Test failed: got attributes 0x22
=== debian11b (64 bit WoW report) ===
ntdll: file.c:4097: Test failed: got attributes 0x22