From: Howard Chu Date: Tue, 14 Aug 2007 18:54:28 +0000 (+0000) Subject: TS#4627 fix tool_entry_first() X-Git-Tag: OPENLDAP_REL_ENG_2_4_MP~217 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b45c15fdc9728fe87a03fe2ba409e733f1114f8e;p=openldap TS#4627 fix tool_entry_first() --- diff --git a/servers/slapd/back-ldif/ldif.c b/servers/slapd/back-ldif/ldif.c index 72fd1be53a..c7614f5e23 100644 --- a/servers/slapd/back-ldif/ldif.c +++ b/servers/slapd/back-ldif/ldif.c @@ -1162,13 +1162,21 @@ static int ldif_tool_entry_close(BackendDB * be) { return 0; } +static ID ldif_tool_entry_next(BackendDB *be) +{ + struct ldif_info *li = (struct ldif_info *) be->be_private; + li->li_tool_current += 1; + if(li->li_tool_current > li->li_tool_cookie.eind) + return NOID; + else + return li->li_tool_current; +} + static ID ldif_tool_entry_first(BackendDB *be) { struct ldif_info *li = (struct ldif_info *) be->be_private; - ID id = 1; /* first entry in the array of entries shifted by one */ - li->li_tool_current = 1; if(li->li_tool_cookie.entries == NULL) { Operation op = {0}; @@ -1180,17 +1188,7 @@ ldif_tool_entry_first(BackendDB *be) (void)enum_tree( &li->li_tool_cookie ); li->li_tool_cookie.op = NULL; } - return id; -} - -static ID ldif_tool_entry_next(BackendDB *be) -{ - struct ldif_info *li = (struct ldif_info *) be->be_private; - li->li_tool_current += 1; - if(li->li_tool_current > li->li_tool_cookie.eind) - return NOID; - else - return li->li_tool_current; + return ldif_tool_entry_next( be ); } static Entry * ldif_tool_entry_get(BackendDB * be, ID id) {