From 52e8543b7b50c4f41b8a10973bf051da1724f4c3 Mon Sep 17 00:00:00 2001
From: Pierangelo Masarati <ando@openldap.org>
Date: Mon, 21 Jun 2004 16:46:41 +0000
Subject: [PATCH] parse page control only in case of succes...

---
 clients/tools/ldapsearch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clients/tools/ldapsearch.c b/clients/tools/ldapsearch.c
index d1ec9dc0c0..56834eb096 100644
--- a/clients/tools/ldapsearch.c
+++ b/clients/tools/ldapsearch.c
@@ -1044,7 +1044,7 @@ static int dosearch(
 			case LDAP_RES_SEARCH_RESULT:
 				rc = print_result( ld, msg, 1 );
 #ifdef LDAP_CONTROL_PAGEDRESULTS
-				if ( pageSize != 0 ) { 
+				if ( rc == LDAP_SUCCESS && pageSize != 0 ) { 
 					rc = parse_page_control( ld, msg, &cookie );
 				}
 #endif
-- 
GitLab