]> git.sur5r.net Git - openldap/commitdiff
prettify matchedDN
authorPierangelo Masarati <ando@openldap.org>
Sun, 28 Aug 2005 14:50:41 +0000 (14:50 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sun, 28 Aug 2005 14:50:41 +0000 (14:50 +0000)
servers/slapd/back-meta/compare.c

index 0b5adf6b35c9d88787aa80df40f366d1b6bef158..82d407fe734adb7ce4bd330bf5933831d69d0e66 100644 (file)
@@ -289,13 +289,19 @@ finish:;
                 * At least one compare failed with matched portion,
                 * and none was successful
                 */
-       } else if ( match != NULL &&  match[0] != '\0' ) {
-               struct berval matched;
+       } else if ( match != NULL && match[ 0 ] != '\0' ) {
+               struct berval matched, pmatched;
 
                ber_str2bv( match, 0, 0, &matched );
 
                dc.ctx = "matchedDN";
                ldap_back_dn_massage( &dc, &matched, &mmatch );
+               if ( dnPretty( NULL, &mmatch, &pmatched, NULL ) == LDAP_SUCCESS ) {
+                       if ( mmatch.bv_val != match ) {
+                               free( mmatch.bv_val );
+                       }
+                       mmatch = pmatched;
+               }
        }
 
        if ( rres != LDAP_SUCCESS ) {