Commit caf384a3 authored by Mark Adamson's avatar Mark Adamson
Browse files

Improve handling of initials in approximate search strings.

parent e138a74d
......@@ -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 );
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment