]> git.sur5r.net Git - openldap/commitdiff
Slightly better ITS#238 fix than last commit... has Debug
authorKurt Zeilenga <kurt@openldap.org>
Wed, 28 Jul 1999 23:19:16 +0000 (23:19 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Wed, 28 Jul 1999 23:19:16 +0000 (23:19 +0000)
message, doesn't bother to open/close index files...

servers/slapd/back-bdb2/index.c
servers/slapd/back-ldbm/index.c

index 825a97e3bd051b8f3e4cf206079ee5536af9dfbc..5e2a97ad3232d75cab8a0698097e8dabc0b40a0b 100644 (file)
@@ -231,6 +231,13 @@ bdb2i_index_add_values(
 
        char            *at_cn;
 
+       if( vals == NULL ) {
+               Debug( LDAP_DEBUG_TRACE,
+                       "=> bdb2i_index_add_values( \"%s\", NULL, %ld )\n",
+                       type, id, 0 );
+               return 0;
+       }
+
        Debug( LDAP_DEBUG_TRACE, "=> bdb2i_index_add_values( \"%s\", %ld )\n", type,
            id, 0 );
        attr_normalize( type );
@@ -248,8 +255,7 @@ bdb2i_index_add_values(
                return( -1 );
        }
 
-       if( vals != NULL ) {
-         for ( i = 0; vals[i] != NULL; i++ ) {
+       for ( i = 0; vals[i] != NULL; i++ ) {
                /*
                 * presence index entry
                 */
@@ -341,7 +347,6 @@ bdb2i_index_add_values(
                if ( bigbuf != NULL ) {
                        free( bigbuf );
                }
-         }
        }
        bdb2i_cache_close( be, db );
 
index 88d279b8882f37da5c64ed354f1ed3c9fbf1f9b1..1a3a468fc20f606bf17ee4f04f688da72248cf8e 100644 (file)
@@ -265,6 +265,13 @@ index_change_values(
        char            *at_cn; /* Attribute canonical name */
        int             mode;
 
+       if( vals == NULL ) {
+               Debug( LDAP_DEBUG_TRACE,
+                       "=> index_change_values( %s, NULL, %ld, op=%s )\n", 
+                       type, id, ((op == __INDEX_ADD_OP) ? "ADD" : "DELETE" ) );
+               return 0;
+       }
+
        Debug( LDAP_DEBUG_TRACE,
               "=> index_change_values( \"%s\", %ld, op=%s )\n", 
               type, id, ((op == __INDEX_ADD_OP) ? "ADD" : "DELETE" ) );
@@ -306,8 +313,7 @@ index_change_values(
        }
 
 
-       if ( vals != NULL ) {
-         for ( i = 0; vals[i] != NULL; i++ ) {
+       for ( i = 0; vals[i] != NULL; i++ ) {
                /*
                 * presence index entry
                 */
@@ -417,7 +423,6 @@ index_change_values(
                if ( bigbuf != NULL ) {
                        free( bigbuf );
                }
-         }
        }
 
        ldbm_cache_close( be, db );