X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fback-bdb%2Fidl.c;h=e48c9ac1fc4dcd3931bf95c36f762ac48dd36a02;hb=d806b970b1b91b4db5998aec7dd5ab610fbe590b;hp=3a4e95efbfb2804256f62517b1d1c1d5ac487139;hpb=dac408369b0812762b3e85f7e024ea472ce79abc;p=openldap diff --git a/servers/slapd/back-bdb/idl.c b/servers/slapd/back-bdb/idl.c index 3a4e95efbf..e48c9ac1fc 100644 --- a/servers/slapd/back-bdb/idl.c +++ b/servers/slapd/back-bdb/idl.c @@ -2,7 +2,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 2000-2011 The OpenLDAP Foundation. + * Copyright 2000-2012 The OpenLDAP Foundation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -1357,6 +1357,10 @@ int bdb_idl_append( ID *a, ID *b ) return 0; } + if ( b[0] == 1 ) { + return bdb_idl_append_one( a, BDB_IDL_FIRST( b )); + } + ida = BDB_IDL_LAST( a ); idb = BDB_IDL_LAST( b ); if ( BDB_IDL_IS_RANGE( a ) || BDB_IDL_IS_RANGE(b) || @@ -1367,7 +1371,7 @@ int bdb_idl_append( ID *a, ID *b ) return 0; } - if ( b[0] > 1 && ida > idb ) { + if ( ida > idb ) { swap = idb; a[a[0]] = idb; b[b[0]] = ida; @@ -1382,7 +1386,7 @@ int bdb_idl_append( ID *a, ID *b ) a[0]++; a[a[0]] = tmp; - if ( b[0] > 1 ) { + { int i = b[0] - 1; AC_MEMCPY(a+a[0]+1, b+2, i * sizeof(ID)); a[0] += i;