From e77ab14f0c7547a4048042526398fb8072c245c8 Mon Sep 17 00:00:00 2001 From: Boleslaw Ciesielski Date: Fri, 9 May 2025 21:46:35 -0700 Subject: [PATCH] ITS#10335 ldapsearch: fix handling of -LL in print_reference() print_reference() was printing comments even when disabled with -LL option. --- clients/tools/ldapsearch.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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 ); } -- 2.47.3