]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#10335 ldapsearch: fix handling of -LL in print_reference()
authorBoleslaw Ciesielski <bolek@live.com>
Sat, 10 May 2025 04:46:35 +0000 (21:46 -0700)
committerQuanah Gibson-Mount <quanah@openldap.org>
Tue, 17 Jun 2025 23:08:02 +0000 (23:08 +0000)
print_reference() was printing comments even when disabled with -LL option.

clients/tools/ldapsearch.c

index 3755a937d2fb2fe7e4b136f696264a71b60c5195..7ab29777e84d8030f382148525c94580bc961a75 100644 (file)
@@ -2061,10 +2061,12 @@ static void print_reference(
        }
 
        if( refs ) {
-               int i;
-               for( i=0; refs[i] != NULL; i++ ) {
-                       tool_write_ldif( ldif ? LDIF_PUT_COMMENT : LDIF_PUT_VALUE,
-                               "ref", refs[i], strlen(refs[i]) );
+               if( ldif < 2 ) {
+                       int i;
+                       for( i=0; refs[i] != NULL; i++ ) {
+                               tool_write_ldif( ldif ? LDIF_PUT_COMMENT : LDIF_PUT_VALUE,
+                                       "ref", refs[i], strlen(refs[i]) );
+                       }
                }
                ber_memvfree( (void **) refs );
        }