+ if ( id != previd ) {
+ data.ulen = data.dlen = sizeof( ehbuf );
+ data.data = ehbuf;
+ data.flags |= DB_DBT_PARTIAL;
+
+ BDB_ID2DISK( id, &nid );
+ rc = cursor->c_get( cursor, &key, &data, DB_SET );
+ if ( rc ) goto done;
+ }
+
+ /* Get the header */
+ dptr = eh.bv.bv_val;
+ eh.bv.bv_val = ehbuf;
+ eh.bv.bv_len = data.size;
+ rc = entry_header( &eh );
+ eoff = eh.data - eh.bv.bv_val;
+ eh.bv.bv_val = dptr;
+ if ( rc ) goto done;
+
+ /* Get the size */
+ data.flags &= ~DB_DBT_PARTIAL;
+ data.ulen = 0;
+ rc = cursor->c_get( cursor, &key, &data, DB_CURRENT );
+ if ( rc != DB_BUFFER_SMALL ) goto done;
+
+ /* Allocate a block and retrieve the data */
+ eh.bv.bv_len = eh.nvals * sizeof( struct berval ) + data.size;
+ eh.bv.bv_val = ch_realloc( eh.bv.bv_val, eh.bv.bv_len );
+ eh.data = eh.bv.bv_val + eh.nvals * sizeof( struct berval );
+ data.data = eh.data;
+ data.ulen = data.size;
+
+ /* Skip past already parsed nattr/nvals */
+ eh.data += eoff;
+
+ rc = cursor->c_get( cursor, &key, &data, DB_CURRENT );
+ if ( rc ) goto done;