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
9712fe1a
...
9712fe1a79215e5b34bf639628a1359ea5b37feb
authored
2003-07-26 11:08:06 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(i_ascii_casemap_contains): Reimplemented via mu_strcasestr()
1 parent
fb9b2300
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
76 deletions
libsieve/comparator.c
libsieve/comparator.c
View file @
9712fe1
...
...
@@ -28,7 +28,7 @@
#include <regex.h>
typedef
struct
{
char
*
name
;
c
onst
c
har
*
name
;
int
required
;
sieve_comparator_t
comp
[
MU_SIEVE_MATCH_LAST
];
}
sieve_comparator_record_t
;
...
...
@@ -413,84 +413,10 @@ i_ascii_casemap_is (const char *pattern, const char *text)
return
strcasecmp
(
pattern
,
text
)
==
0
;
}
/* Based on strstr from GNU libc (Stephen R. van den Berg,
berg@pool.informatik.rwth-aachen.de) */
static
int
i_ascii_casemap_contains
(
const
char
*
pattern
,
const
char
*
text
)
{
register
const
unsigned
char
*
haystack
,
*
needle
;
register
unsigned
int
b
,
c
;
#define U(c) toupper (c)
haystack
=
(
const
unsigned
char
*
)
text
;
if
((
b
=
U
(
*
(
needle
=
(
const
unsigned
char
*
)
pattern
))))
{
haystack
--
;
do
{
if
(
!
(
c
=
*++
haystack
))
goto
ret0
;
}
while
(
U
(
c
)
!=
b
);
if
(
!
(
c
=
*++
needle
))
goto
foundneedle
;
c
=
U
(
c
);
++
needle
;
goto
jin
;
for
(;;)
{
register
unsigned
int
a
;
register
const
unsigned
char
*
rhaystack
,
*
rneedle
;
do
{
if
(
!
(
a
=
*++
haystack
))
goto
ret0
;
if
(
U
(
a
)
==
b
)
break
;
if
(
!
(
a
=
*++
haystack
))
goto
ret0
;
shloop:
;
}
while
(
U
(
a
)
!=
b
);
jin:
if
(
!
(
a
=
*++
haystack
))
goto
ret0
;
if
(
U
(
a
)
!=
c
)
goto
shloop
;
if
(
U
(
*
(
rhaystack
=
haystack
--
+
1
))
==
(
a
=
U
(
*
(
rneedle
=
needle
))))
do
{
if
(
!
a
)
goto
foundneedle
;
if
(
U
(
*++
rhaystack
)
!=
(
a
=
U
(
*++
needle
)))
break
;
if
(
!
a
)
goto
foundneedle
;
}
while
(
U
(
*++
rhaystack
)
==
(
a
=
U
(
*++
needle
)));
needle
=
rneedle
;
if
(
!
a
)
break
;
}
}
foundneedle:
return
1
;
ret0:
return
0
;
#undef U
return
mu_strcasestr
(
text
,
pattern
)
!=
NULL
;
}
static
int
...
...
Please
register
or
sign in
to post a comment