Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
bfc095f2
...
bfc095f278820d4edca6d00c4cee7db3de86967e
authored
2002-04-10 13:22:13 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Removed imap_match().
1 parent
56c35253
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
51 deletions
imap4d/list.c
imap4d/list.c
View file @
bfc095f
...
...
@@ -53,7 +53,6 @@ struct inode_list
but it does not match ahierarchy delimiter. */
static
int
match
__P
((
const
char
*
,
const
char
*
,
const
char
*
));
static
int
imap_match
__P
((
const
char
*
,
const
char
*
,
const
char
*
));
static
void
list_file
__P
((
const
char
*
,
const
char
*
,
const
char
*
,
const
char
*
,
struct
inode_list
*
));
static
void
print_file
__P
((
const
char
*
,
const
char
*
,
const
char
*
));
static
void
print_dir
__P
((
const
char
*
,
const
char
*
,
const
char
*
));
...
...
@@ -328,7 +327,20 @@ static int
match
(
const
char
*
entry
,
const
char
*
pattern
,
const
char
*
delim
)
{
struct
stat
stats
;
int
status
=
imap_match
(
entry
,
pattern
,
delim
);
int
status
=
util_wcard_match
(
entry
,
pattern
,
delim
);
switch
(
status
)
{
case
WCARD_RECURSE_MATCH
:
status
=
RECURSE_MATCH
;
break
;
case
WCARD_MATCH
:
status
=
MATCH
;
break
;
case
WCARD_NOMATCH
:
status
=
NOMATCH
;
}
if
(
status
)
{
if
(
stat
(
entry
,
&
stats
)
==
0
)
...
...
@@ -337,52 +349,3 @@ match (const char *entry, const char *pattern, const char *delim)
return
status
;
}
/* Match STRING against the filename pattern PATTERN, returning zero if
it matches, nonzero if not. */
static
int
imap_match
(
const
char
*
string
,
const
char
*
pattern
,
const
char
*
delim
)
{
const
char
*
p
=
pattern
,
*
n
=
string
;
char
c
;
for
(;(
c
=
*
p
++
)
!=
'\0'
&&
*
n
;
n
++
)
{
switch
(
c
)
{
case
'%'
:
if
(
*
p
==
'\0'
)
{
/* Matches everything except '/' */
for
(;
*
n
&&
*
n
!=
delim
[
0
];
n
++
)
;
return
(
*
n
==
'/'
)
?
RECURSE_MATCH
:
MATCH
;
}
else
for
(;
*
n
!=
'\0'
;
++
n
)
if
(
imap_match
(
n
,
p
,
delim
)
==
MATCH
)
return
MATCH
;
break
;
case
'*'
:
if
(
*
p
==
'\0'
)
return
RECURSE_MATCH
;
for
(;
*
n
!=
'\0'
;
++
n
)
{
int
status
=
imap_match
(
n
,
p
,
delim
);
if
(
status
==
MATCH
||
status
==
RECURSE_MATCH
)
return
status
;
}
break
;
default:
if
(
c
!=
*
n
)
return
NOMATCH
;
}
}
if
(
!
c
&&
!*
n
)
return
MATCH
;
return
NOMATCH
;
}
...
...
Please
register
or
sign in
to post a comment