Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
openldap
OpenLDAP
Commits
ec9db8de
Commit
ec9db8de
authored
Feb 25, 2003
by
Kurt Zeilenga
Browse files
Quick (and incomplete) fix to " foo " indexing
parent
02b98006
Changes
1
Hide whitespace changes
Inline
Side-by-side
servers/slapd/schema_init.c
View file @
ec9db8de
...
...
@@ -1246,8 +1246,8 @@ static int caseExactIgnoreIndexer(
BerVarray
values
,
BerVarray
*
keysp
)
{
int
i
;
unsigned
casefold
;
int
i
,
j
;
unsigned
casefold
,
wasspace
;
size_t
slen
,
mlen
;
BerVarray
keys
;
HASH_CONTEXT
HASHcontext
;
...
...
@@ -1272,9 +1272,33 @@ static int caseExactIgnoreIndexer(
?
LDAP_UTF8_CASEFOLD
:
LDAP_UTF8_NOCASEFOLD
;
for
(
i
=
0
;
values
[
i
].
bv_val
!=
NULL
;
i
++
)
{
struct
berval
value
;
struct
berval
value
,
nvalue
;
UTF8bvnormalize
(
&
values
[
i
],
&
value
,
casefold
);
/* collapse spaces (in place) */
nvalue
.
bv_len
=
0
;
nvalue
.
bv_val
=
value
.
bv_val
;
wasspace
=
1
;
for
(
j
=
0
;
j
<
value
.
bv_len
;
j
++
)
{
if
(
ASCII_SPACE
(
value
.
bv_val
[
j
]
))
{
if
(
wasspace
++
==
0
)
{
nvalue
.
bv_val
[
nvalue
.
bv_len
++
]
=
value
.
bv_val
[
j
];
}
}
else
{
wasspace
=
0
;
nvalue
.
bv_val
[
nvalue
.
bv_len
++
]
=
value
.
bv_val
[
j
];
}
}
if
(
nvalue
.
bv_len
==
0
)
{
nvalue
.
bv_val
=
" "
;
nvalue
.
bv_len
=
sizeof
(
" "
)
-
1
;
}
else
{
if
(
wasspace
)
--
nvalue
.
bv_len
;
nvalue
.
bv_val
[
nvalue
.
bv_len
]
=
'\0'
;
}
HASH_Init
(
&
HASHcontext
);
if
(
prefix
!=
NULL
&&
prefix
->
bv_len
>
0
)
{
HASH_Update
(
&
HASHcontext
,
...
...
@@ -1285,11 +1309,10 @@ static int caseExactIgnoreIndexer(
HASH_Update
(
&
HASHcontext
,
mr
->
smr_oid
,
mlen
);
HASH_Update
(
&
HASHcontext
,
value
.
bv_val
,
value
.
bv_len
);
n
value
.
bv_val
,
n
value
.
bv_len
);
HASH_Final
(
HASHdigest
,
&
HASHcontext
);
free
(
value
.
bv_val
);
ber_dupbv
(
&
keys
[
i
],
&
digest
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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