mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
Improve handling of initials in approximate search strings.
This commit is contained in:
parent
e138a74d48
commit
caf384a37c
@ -788,17 +788,21 @@ approxMatch(
|
||||
len = 0;
|
||||
while ( nextchunk < ((struct berval *)assertedValue)->bv_len ) {
|
||||
len = strcspn( assertv + nextchunk, SLAPD_APPROX_DELIMITER);
|
||||
if( len == 0 ) {
|
||||
nextchunk++;
|
||||
continue;
|
||||
}
|
||||
#if defined(SLAPD_APPROX_INITIALS)
|
||||
if( len <= 1 ) {
|
||||
else if( len == 1 ) {
|
||||
/* Single letter words need to at least match one word's initial */
|
||||
for( i=nextavail; i<count; i++ )
|
||||
if( !strncasecmp( assertv+nextchunk, words[i], 1 ))
|
||||
if( !strncasecmp( assertv+nextchunk, words[i], 1 )) {
|
||||
nextavail=i+1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
#endif
|
||||
{
|
||||
else {
|
||||
/* Isolate the next word in the asserted value and phonetic it */
|
||||
assertv[nextchunk+len] = '\0';
|
||||
val = phonetic( assertv + nextchunk );
|
||||
|
Loading…
Reference in New Issue
Block a user