Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
9ff05696
Commit
9ff05696
authored
Aug 30, 2023
by
Paul Gofman
Committed by
Alexandre Julliard
Sep 04, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernelbase: Support masks suggesting no extension in FindNextFile().
parent
a90f695f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
6 deletions
+27
-6
file.c
dlls/kernel32/tests/file.c
+6
-6
file.c
dlls/kernelbase/file.c
+21
-0
No files found.
dlls/kernel32/tests/file.c
View file @
9ff05696
...
@@ -2974,21 +2974,21 @@ static void test_FindFirstFile_wildcards(void)
...
@@ -2974,21 +2974,21 @@ static void test_FindFirstFile_wildcards(void)
{
0
,
".*.*"
,
", '.', '..', '..a', '..a.a', '.a', '.a..a', '.a.a', '.aaa'"
},
{
0
,
".*.*"
,
", '.', '..', '..a', '..a.a', '.a', '.a..a', '.a.a', '.aaa'"
},
{
0
,
"*.*"
,
", '.', '..', '..a', '..a.a', '.a', '.a..a', '.a.a', '.aaa', 'a', 'a..a', 'a.a', 'a.a.a', 'aa', 'aaa', 'aaaa', ' .a'"
},
{
0
,
"*.*"
,
", '.', '..', '..a', '..a.a', '.a', '.a..a', '.a.a', '.aaa', 'a', 'a..a', 'a.a', 'a.a.a', 'aa', 'aaa', 'aaaa', ' .a'"
},
{
0
,
".*"
,
", '.', '..', '..a', '..a.a', '.a', '.a..a', '.a.a', '.aaa'"
},
{
0
,
".*"
,
", '.', '..', '..a', '..a.a', '.a', '.a..a', '.a.a', '.aaa'"
},
{
1
,
"*."
,
", '.', '..', 'a', '.a', '..a', 'aa', 'aaa', 'aaaa', '.aaa'"
},
{
0
,
"*."
,
", '.', '..', 'a', '.a', '..a', 'aa', 'aaa', 'aaaa', '.aaa'"
},
{
0
,
"*"
,
", '.', '..', '..a', '..a.a', '.a', '.a..a', '.a.a', '.aaa', 'a', 'a..a', 'a.a', 'a.a.a', 'aa', 'aaa', 'aaaa', ' .a'"
},
{
0
,
"*"
,
", '.', '..', '..a', '..a.a', '.a', '.a..a', '.a.a', '.aaa', 'a', 'a..a', 'a.a', 'a.a.a', 'aa', 'aaa', 'aaaa', ' .a'"
},
{
1
,
"*..*"
,
", '.', '..', '..a', '..a.a', '.a..a', 'a..a'"
},
{
1
,
"*..*"
,
", '.', '..', '..a', '..a.a', '.a..a', 'a..a'"
},
{
1
,
"*.."
,
", '.', '..', 'a', '.a', '..a', 'aa', 'aaa', 'aaaa', '.aaa'"
},
{
0
,
"*.."
,
", '.', '..', 'a', '.a', '..a', 'aa', 'aaa', 'aaaa', '.aaa'"
},
{
1
,
".*."
,
", '.', '..', '.a', '.aaa'"
},
{
1
,
".*."
,
", '.', '..', '.a', '.aaa'"
},
{
0
,
"..*"
,
", '.', '..', '..a', '..a.a'"
},
{
0
,
"..*"
,
", '.', '..', '..a', '..a.a'"
},
{
0
,
"**"
,
", '.', '..', '..a', '..a.a', '.a', '.a..a', '.a.a', '.aaa', 'a', 'a..a', 'a.a', 'a.a.a', 'aa', 'aaa', 'aaaa', ' .a'"
},
{
0
,
"**"
,
", '.', '..', '..a', '..a.a', '.a', '.a..a', '.a.a', '.aaa', 'a', 'a..a', 'a.a', 'a.a.a', 'aa', 'aaa', 'aaaa', ' .a'"
},
{
0
,
"**."
,
", '.', '..', '..a', '..a.a', '.a', '.a..a', '.a.a', '.aaa', 'a', 'a..a', 'a.a', 'a.a.a', 'aa', 'aaa', 'aaaa', ' .a'"
},
{
0
,
"**."
,
", '.', '..', '..a', '..a.a', '.a', '.a..a', '.a.a', '.aaa', 'a', 'a..a', 'a.a', 'a.a.a', 'aa', 'aaa', 'aaaa', ' .a'"
},
{
0
,
"*. "
,
", '.', '..', '..a', '..a.a', '.a', '.a..a', '.a.a', '.aaa', 'a', 'a..a', 'a.a', 'a.a.a', 'aa', 'aaa', 'aaaa', ' .a'"
},
{
0
,
"*. "
,
", '.', '..', '..a', '..a.a', '.a', '.a..a', '.a.a', '.aaa', 'a', 'a..a', 'a.a', 'a.a.a', 'aa', 'aaa', 'aaaa', ' .a'"
},
{
1
,
"* ."
,
", '.', '..', 'a', '.a', '..a', 'aa', 'aaa', 'aaaa', '.aaa'"
},
{
0
,
"* ."
,
", '.', '..', 'a', '.a', '..a', 'aa', 'aaa', 'aaaa', '.aaa'"
},
{
0
,
"* . "
,
", '.', '..', '..a', '..a.a', '.a', '.a..a', '.a.a', '.aaa', 'a', 'a..a', 'a.a', 'a.a.a', 'aa', 'aaa', 'aaaa', ' .a'"
},
{
0
,
"* . "
,
", '.', '..', '..a', '..a.a', '.a', '.a..a', '.a.a', '.aaa', 'a', 'a..a', 'a.a', 'a.a.a', 'aa', 'aaa', 'aaaa', ' .a'"
},
{
0
,
"*.. "
,
", '.', '..', '..a', '..a.a', '.a', '.a..a', '.a.a', '.aaa', 'a', 'a..a', 'a.a', 'a.a.a', 'aa', 'aaa', 'aaaa', ' .a'"
},
{
0
,
"*.. "
,
", '.', '..', '..a', '..a.a', '.a', '.a..a', '.a.a', '.aaa', 'a', 'a..a', 'a.a', 'a.a.a', 'aa', 'aaa', 'aaaa', ' .a'"
},
{
1
,
"*. ."
,
", '.', '..', 'a', '.a', '..a', 'aa', 'aaa', 'aaaa', '.aaa'"
},
{
0
,
"*. ."
,
", '.', '..', 'a', '.a', '..a', 'aa', 'aaa', 'aaaa', '.aaa'"
},
{
1
,
"* .."
,
", '.', '..', 'a', '.a', '..a', 'aa', 'aaa', 'aaaa', '.aaa'"
},
{
0
,
"* .."
,
", '.', '..', 'a', '.a', '..a', 'aa', 'aaa', 'aaaa', '.aaa'"
},
{
1
,
" *.."
,
""
},
{
0
,
" *.."
,
""
},
{
0
,
"..* "
,
", '.', '..', '..a', '..a.a'"
},
{
0
,
"..* "
,
", '.', '..', '..a', '..a.a'"
},
{
1
,
"a*."
,
", '..a', '.a', '.aaa', 'a', 'aa', 'aaa', 'aaaa'"
},
{
1
,
"a*."
,
", '..a', '.a', '.aaa', 'a', 'aa', 'aaa', 'aaaa'"
},
{
0
,
"*a "
,
", '..a', '..a.a', '.a', '.a..a', '.a.a', '.aaa', 'a', 'a..a', 'a.a', 'a.a.a', 'aa', 'aaa', 'aaaa', ' .a'"
},
{
0
,
"*a "
,
", '..a', '..a.a', '.a', '.a..a', '.a.a', '.aaa', 'a', 'a..a', 'a.a', 'a.a.a', 'aa', 'aaa', 'aaaa', ' .a'"
},
...
...
dlls/kernelbase/file.c
View file @
9ff05696
...
@@ -1348,6 +1348,19 @@ BOOL WINAPI DECLSPEC_HOTPATCH FindNextFileA( HANDLE handle, WIN32_FIND_DATAA *da
...
@@ -1348,6 +1348,19 @@ BOOL WINAPI DECLSPEC_HOTPATCH FindNextFileA( HANDLE handle, WIN32_FIND_DATAA *da
/***********************************************************************
/***********************************************************************
* name_has_ext
*
* Check if the file name has extension (skipping leading dots).
*/
static
BOOL
name_has_ext
(
const
WCHAR
*
name
,
const
WCHAR
*
name_end
)
{
while
(
name
!=
name_end
&&
*
name
==
'.'
)
++
name
;
while
(
name
!=
name_end
&&
*
name
!=
'.'
)
++
name
;
return
name
!=
name_end
;
}
/***********************************************************************
* match_filename
* match_filename
*
*
* Check if the file name matches mask containing wildcards.
* Check if the file name matches mask containing wildcards.
...
@@ -1359,6 +1372,14 @@ static BOOL match_filename( const WCHAR *name, int length, const WCHAR *mask )
...
@@ -1359,6 +1372,14 @@ static BOOL match_filename( const WCHAR *name, int length, const WCHAR *mask )
const
WCHAR
*
mask_end
=
mask
+
lstrlenW
(
mask
);
const
WCHAR
*
mask_end
=
mask
+
lstrlenW
(
mask
);
const
WCHAR
*
lastjoker
=
NULL
;
const
WCHAR
*
lastjoker
=
NULL
;
const
WCHAR
*
next_to_retry
=
NULL
;
const
WCHAR
*
next_to_retry
=
NULL
;
const
WCHAR
*
asterisk
;
if
(
mask
!=
mask_end
&&
mask_end
[
-
1
]
==
'.'
&&
(
asterisk
=
wcschr
(
mask
,
'*'
))
&&
asterisk
==
wcsrchr
(
mask
,
'*'
)
&&
name_has_ext
(
name
,
name_end
))
{
/* Single '*' mask ending with '.' only matches files without extension. */
return
FALSE
;
}
while
(
name
<
name_end
&&
mask
<
mask_end
)
while
(
name
<
name_end
&&
mask
<
mask_end
)
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment