ITS#10335 ldapsearch: fix handling of -LL in print_reference()

print_reference() was printing comments even when disabled with -LL option.
This commit is contained in:
Boleslaw Ciesielski 2025-05-09 21:46:35 -07:00 committed by Quanah Gibson-Mount
parent 87a2d70750
commit e77ab14f0c

View 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 );
}