From: Howard Chu Date: Mon, 12 Aug 2013 00:25:00 +0000 (-0700) Subject: Tweak NODUPDATA flag check X-Git-Tag: OPENLDAP_REL_ENG_2_4_36~5^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6ecee1cbf9c6cad8665e2e3233e5a581f16a402b;p=openldap Tweak NODUPDATA flag check Should allow for the possibility of future flag combos. --- diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index c1f0d030a0..ceda38510b 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -5655,7 +5655,7 @@ more: #endif /* if data matches, skip it */ if (!mc->mc_dbx->md_dcmp(data, &dkey)) { - if (flags == MDB_NODUPDATA) + if (flags & MDB_NODUPDATA) rc = MDB_KEYEXIST; else if (flags & MDB_MULTIPLE) goto next_mult; @@ -5987,7 +5987,7 @@ mdb_cursor_del(MDB_cursor *mc, unsigned int flags) leaf = NODEPTR(mc->mc_pg[mc->mc_top], mc->mc_ki[mc->mc_top]); if (!IS_LEAF2(mc->mc_pg[mc->mc_top]) && F_ISSET(leaf->mn_flags, F_DUPDATA)) { - if (flags != MDB_NODUPDATA) { + if (!(flags & MDB_NODUPDATA)) { if (!F_ISSET(leaf->mn_flags, F_SUBDATA)) { mc->mc_xcursor->mx_cursor.mc_pg[0] = NODEDATA(leaf); }