[Bug 7961] Bug in findfirst/findnext

WineHQ Bugzilla wine-bugs at winehq.org
Thu Nov 12 10:56:45 CST 2020


https://bugs.winehq.org/show_bug.cgi?id=7961

Damjan Jovanovic <damjan.jov at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |damjan.jov at gmail.com

--- Comment #23 from Damjan Jovanovic <damjan.jov at gmail.com> ---
(In reply to Jason Edmeades from comment #7)
> Similarly there are other pattern matching problems, and I havent looked to 
> see if these are cause by findfirst/findnext (I am guessing they are), but 
> I'll list them here for reference for when this bug is debugged - In 
> windows, 'dir ???' lists all entries up to 3 characters in length which do
> not 
> have a '.' in them. In wine if shows entries of exactly 3 entries and even 
> includes ones with a . (eg. 'a.a')

The:
dir "???"
problem, at least, is easy to fix. All we have to do is skip trailing unmatched
"?"s like we already do for "*" and ".". A (preliminary) patch such as the
following works. However, while "a" and "aa" are correctly matched for "???",
"a.a" is wrongly matched too - apparently the "." in filenames needs special
handling.

diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index cf413f46e5c..5d567358f88 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -1375,8 +1375,8 @@ static BOOLEAN match_filename( const WCHAR *name, int
length, const UNICODE_STRI
             break;
         }
     }
-    while (mask < mask_end && ((*mask == '.') || (*mask == '*')))
-        mask++;  /* Ignore trailing '.' or '*' in mask */
+    while (mask < mask_end && ((*mask == '.') || (*mask == '*') || (*mask ==
'?')))
+        mask++;  /* Ignore trailing '.' or '*' or '?' in mask */
     return (name == name_end && mask == mask_end);
 }

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list