From: Boleslaw Ciesielski Date: Sat, 10 May 2025 04:46:35 +0000 (-0700) Subject: ITS#10335 ldapsearch: fix handling of -LL in print_reference() X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=73433f215daccd37dc5870b46bb7996cfd37197f;p=thirdparty%2Fopenldap.git ITS#10335 ldapsearch: fix handling of -LL in print_reference() print_reference() was printing comments even when disabled with -LL option. --- diff --git a/clients/tools/ldapsearch.c b/clients/tools/ldapsearch.c index 3755a937d2..7ab29777e8 100644 --- a/clients/tools/ldapsearch.c +++ b/clients/tools/ldapsearch.c @@ -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 ); }