]> git.sur5r.net Git - openldap/commitdiff
More for ITS#5317
authorQuanah Gibson-Mount <quanah@openldap.org>
Tue, 12 Feb 2008 20:59:20 +0000 (20:59 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Tue, 12 Feb 2008 20:59:20 +0000 (20:59 +0000)
clients/tools/ldapsearch.c

index b82c71cc4943b69f69da5de7a527305a843df5e0..d5700362989de0c7a4db7b8a9710c533a205aba2 100644 (file)
@@ -625,7 +625,7 @@ main( int argc, char **argv )
 {
        char            *filtpattern, **attrs = NULL, line[BUFSIZ];
        FILE            *fp = NULL;
-       int             rc, i, first;
+       int                     rc, rc1, i, first;
        LDAP            *ld = NULL;
        BerElement      *seber = NULL, *vrber = NULL;
 
@@ -990,11 +990,13 @@ getNextPage:
                        } else {
                                first = 0;
                        }
-                       rc = dosearch( ld, base, scope, filtpattern, line,
+                       rc1 = dosearch( ld, base, scope, filtpattern, line,
                                attrs, attrsonly, NULL, NULL, NULL, -1 );
 
-                       if ( rc != 0 && !contoper ) {
-                               break;
+                       if ( rc1 != 0 ) {
+                               rc = rc1;
+                               if ( !contoper )
+                                       break;
                        }
                }
                if ( fp != stdin ) {