Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
e4f61b63
Commit
e4f61b63
authored
Sep 10, 1999
by
Niclas Karlsson
Committed by
Alexandre Julliard
Sep 10, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed pattern matching in PathMatchSpecA/W
parent
dd93b71c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
55 deletions
+66
-55
shellpath.c
dlls/shell32/shellpath.c
+66
-55
No files found.
dlls/shell32/shellpath.c
View file @
e4f61b63
...
...
@@ -422,77 +422,88 @@ BOOL WINAPI PathFileExistsA(LPSTR fn) {
return
TRUE
;
}
/*************************************************************************
* PathMatchSingleMask
*
* NOTES
* internal (used by PathMatchSpec)
*/
static
BOOL
PathMatchSingleMaskA
(
LPCSTR
name
,
LPCSTR
mask
)
{
while
(
*
name
&&
*
mask
&&
*
mask
!=
';'
)
{
if
(
*
mask
==
'*'
)
{
do
{
if
(
PathMatchSingleMaskA
(
name
,
mask
+
1
))
return
1
;
/* try substrings */
}
while
(
*
name
++
);
return
0
;
}
if
(
toupper
(
*
mask
)
!=
toupper
(
*
name
)
&&
*
mask
!=
'?'
)
return
0
;
name
++
;
mask
++
;
}
if
(
!*
name
)
{
while
(
*
mask
==
'*'
)
mask
++
;
if
(
!*
mask
||
*
mask
==
';'
)
return
1
;
}
return
0
;
}
static
BOOL
PathMatchSingleMaskW
(
LPCWSTR
name
,
LPCWSTR
mask
)
{
while
(
*
name
&&
*
mask
&&
*
mask
!=
';'
)
{
if
(
*
mask
==
'*'
)
{
do
{
if
(
PathMatchSingleMaskW
(
name
,
mask
+
1
))
return
1
;
/* try substrings */
}
while
(
*
name
++
);
return
0
;
}
if
(
towupper
(
*
mask
)
!=
towupper
(
*
name
)
&&
*
mask
!=
'?'
)
return
0
;
name
++
;
mask
++
;
}
if
(
!*
name
)
{
while
(
*
mask
==
'*'
)
mask
++
;
if
(
!*
mask
||
*
mask
==
';'
)
return
1
;
}
return
0
;
}
/*************************************************************************
* PathMatchSpec [SHELL32.46]
*
* NOTES
* used from COMDLG32
*/
BOOL
WINAPI
PathMatchSpecA
(
LPCSTR
name
,
LPCSTR
mask
)
{
LPCSTR
_name
;
{
TRACE
(
"%s %s
\n
"
,
name
,
mask
);
TRACE
(
"%s %s stub
\n
"
,
name
,
mask
);
if
(
!
lstrcmpA
(
mask
,
"*.*"
))
return
1
;
/* we don't require a period */
_name
=
name
;
while
(
*
_name
&&
*
mask
)
{
if
(
*
mask
==
';'
)
{
mask
++
;
_name
=
name
;
}
else
if
(
*
mask
==
'*'
)
{
mask
++
;
while
(
*
mask
==
'*'
)
mask
++
;
/* Skip consecutive '*' */
if
(
!*
mask
||
*
mask
==
';'
)
return
TRUE
;
/* '*' matches everything */
while
(
*
_name
&&
(
toupper
(
*
_name
)
!=
toupper
(
*
mask
)))
_name
++
;
if
(
!*
_name
)
{
while
(
*
mask
&&
*
mask
!=
';'
)
mask
++
;
_name
=
name
;
}
}
else
if
(
(
*
mask
==
'?'
)
||
(
toupper
(
*
mask
)
==
toupper
(
*
_name
))
)
{
mask
++
;
_name
++
;
}
else
{
while
(
*
mask
&&
*
mask
!=
';'
)
mask
++
;
while
(
*
mask
)
{
if
(
PathMatchSingleMaskA
(
name
,
mask
))
return
1
;
/* helper function */
while
(
*
mask
&&
*
mask
!=
';'
)
mask
++
;
if
(
*
mask
==
';'
)
{
mask
++
;
while
(
*
mask
==
' '
)
mask
++
;
/* masks may be separated by "; " */
}
}
return
(
!*
_name
&&
(
!*
mask
||
*
mask
==
';'
))
;
return
0
;
}
BOOL
WINAPI
PathMatchSpecW
(
LPCWSTR
name
,
LPCWSTR
mask
)
{
WCHAR
stemp
[
4
];
LPCWSTR
_name
;
TRACE
(
"%s %s stub
\n
"
,
debugstr_w
(
name
),
debugstr_w
(
mask
));
{
WCHAR
stemp
[
4
];
TRACE
(
"%s %s
\n
"
,
debugstr_w
(
name
),
debugstr_w
(
mask
));
lstrcpyAtoW
(
stemp
,
"*.*"
);
if
(
!
lstrcmpW
(
mask
,
stemp
))
return
1
;
_name
=
name
;
while
(
*
_name
&&
*
mask
)
{
if
(
*
mask
==
';'
)
{
mask
++
;
_name
=
name
;
}
else
if
(
*
mask
==
'*'
)
{
mask
++
;
while
(
*
mask
==
'*'
)
mask
++
;
/* Skip consecutive '*' */
if
(
!*
mask
||
*
mask
==
';'
)
return
TRUE
;
/* '*' matches everything */
while
(
*
_name
&&
(
towupper
(
*
_name
)
!=
towupper
(
*
mask
)))
_name
++
;
if
(
!*
_name
)
{
while
(
*
mask
&&
*
mask
!=
';'
)
mask
++
;
_name
=
name
;
}
}
else
if
(
(
*
mask
==
'?'
)
||
(
towupper
(
*
mask
)
==
towupper
(
*
_name
))
)
{
mask
++
;
_name
++
;
}
else
{
while
(
*
mask
&&
*
mask
!=
';'
)
mask
++
;
if
(
!
lstrcmpW
(
mask
,
stemp
))
return
1
;
/* we don't require a period */
while
(
*
mask
)
{
if
(
PathMatchSingleMaskW
(
name
,
mask
))
return
1
;
/* helper function */
while
(
*
mask
&&
*
mask
!=
';'
)
mask
++
;
if
(
*
mask
==
';'
)
{
mask
++
;
while
(
*
mask
==
' '
)
mask
++
;
/* masks may be separated by "; " */
}
}
return
(
!*
_name
&&
(
!*
mask
||
*
mask
==
';'
))
;
return
0
;
}
BOOL
WINAPI
PathMatchSpecAW
(
LPVOID
name
,
LPVOID
mask
)
{
if
(
VERSION_OsIsUnicode
())
...
...
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