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
07291056
Commit
07291056
authored
Sep 07, 2000
by
Andreas Mohr
Committed by
Alexandre Julliard
Sep 07, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DOSFS_MatchLong ignored several things about file mask matching for
long file names.
parent
566e77ba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
6 deletions
+59
-6
dos_fs.c
files/dos_fs.c
+59
-6
No files found.
files/dos_fs.c
View file @
07291056
...
...
@@ -289,10 +289,24 @@ static int DOSFS_MatchShort( const char *mask, const char *name )
* DOSFS_MatchLong
*
* Check a long file name against a mask.
*
* Tests (done in W95 DOS shell - case insensitive):
* *.txt test1.test.txt *
* *st1* test1.txt *
* *.t??????.t* test1.ta.tornado.txt *
* *tornado* test1.ta.tornado.txt *
* t*t test1.ta.tornado.txt *
* ?est* test1.txt *
* ?est??? test1.txt -
* *test1.txt* test1.txt *
* h?l?o*t.dat hellothisisatest.dat *
*/
static
int
DOSFS_MatchLong
(
const
char
*
mask
,
const
char
*
name
,
int
case_sensitive
)
{
const
char
*
lastjoker
=
NULL
;
const
char
*
next_to_retry
=
NULL
;
if
(
!
strcmp
(
mask
,
"*.*"
))
return
1
;
while
(
*
name
&&
*
mask
)
{
...
...
@@ -300,23 +314,62 @@ static int DOSFS_MatchLong( const char *mask, const char *name,
{
mask
++
;
while
(
*
mask
==
'*'
)
mask
++
;
/* Skip consecutive '*' */
if
(
!*
mask
)
return
1
;
lastjoker
=
mask
;
if
(
!*
mask
)
return
1
;
/* end of mask is all '*', so match */
/* skip to the next match after the joker(s) */
if
(
case_sensitive
)
while
(
*
name
&&
(
*
name
!=
*
mask
))
name
++
;
else
while
(
*
name
&&
(
toupper
(
*
name
)
!=
toupper
(
*
mask
)))
name
++
;
if
(
!*
name
)
break
;
next_to_retry
=
name
;
}
else
if
(
*
mask
!=
'?'
)
{
int
mismatch
=
0
;
if
(
case_sensitive
)
{
if
(
*
mask
!=
*
name
)
return
0
;
if
(
*
mask
!=
*
name
)
mismatch
=
1
;
}
else
if
(
toupper
(
*
mask
)
!=
toupper
(
*
name
))
return
0
;
else
{
if
(
toupper
(
*
mask
)
!=
toupper
(
*
name
))
mismatch
=
1
;
}
if
(
!
mismatch
)
{
mask
++
;
name
++
;
if
(
*
mask
==
'\0'
)
{
if
(
*
name
==
'\0'
)
return
1
;
if
(
lastjoker
)
mask
=
lastjoker
;
}
}
else
/* mismatch ! */
{
if
(
lastjoker
)
/* we had an '*', so we can try unlimitedly */
{
mask
=
lastjoker
;
/* this scan sequence was a mismatch, so restart
* 1 char after the first char we checked last time */
next_to_retry
++
;
name
=
next_to_retry
;
}
else
return
0
;
/* bad luck */
}
}
else
/* '?' */
{
mask
++
;
name
++
;
}
mask
++
;
name
++
;
}
if
(
*
mask
==
'.'
)
mask
++
;
/* Ignore trailing '.' in mask */
while
((
*
mask
==
'.'
)
||
(
*
mask
==
'*'
))
mask
++
;
/* Ignore trailing '.' or '*' in mask */
return
(
!*
name
&&
!*
mask
);
}
...
...
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