Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
openldap
OpenLDAP
Commits
32b955cf
Commit
32b955cf
authored
Jan 17, 2002
by
Kurt Zeilenga
Browse files
replace strcasechr with bvcasechr
parent
1b6811d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
servers/slapd/schema_init.c
View file @
32b955cf
...
...
@@ -81,18 +81,20 @@
#define caseExactMatchOID "2.5.13.5"
#define caseExactSubstringsMatchOID "2.5.13.7"
static
char
*
str
casechr
(
const
char
*
str
,
int
c
)
static
char
*
bv
casechr
(
struct
berval
*
bv
,
int
c
,
ber_len_t
*
len
)
{
char
*
lower
=
strchr
(
str
,
TOLOWER
(
c
)
)
;
char
*
upper
=
strchr
(
str
,
TOUPP
ER
(
c
)
);
if
(
lower
&&
upper
)
{
return
lower
<
upper
?
lower
:
upper
;
}
else
if
(
lower
)
{
return
lower
;
}
else
{
return
upper
;
ber_len_t
i
;
int
lower
=
TOLOW
ER
(
c
);
int
upper
=
TOUPPER
(
c
);
for
(
i
=
0
;
i
<
bv
->
bv_len
;
i
++
)
{
if
(
upper
==
bv
->
bv_val
[
i
]
||
lower
==
bv
->
bv_val
[
i
]
)
{
*
len
=
i
;
return
&
bv
->
bv_val
[
i
];
}
}
return
NULL
;
}
static
int
...
...
@@ -2724,14 +2726,14 @@ retry:
continue
;
}
p
=
str
casechr
(
left
.
bv_val
,
*
sub
->
sa_any
[
i
].
bv_val
);
p
=
bv
casechr
(
&
left
,
*
sub
->
sa_any
[
i
].
bv_val
,
&
idx
);
if
(
p
==
NULL
)
{
match
=
1
;
goto
done
;
}
idx
=
p
-
left
.
bv_
val
;
assert
(
idx
<
left
.
bv_
len
)
;
if
(
idx
>=
left
.
bv_len
)
{
/* this shouldn't happen */
return
LDAP_OTHER
;
...
...
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