slight cleanup: make more clear, it's an array
authorPeter Marschall <peter@adpm.de>
Sat, 05 Mar 2011 19:15:48 +0100
changeset 21 cf8013cbfb58
parent 20 d956658803b8
child 22 8c212bdb221b
slight cleanup: make more clear, it's an array
shelldap
--- a/shelldap	Sat Mar 05 19:08:50 2011 +0100
+++ b/shelldap	Sat Mar 05 19:15:48 2011 +0100
@@ -927,8 +927,7 @@
 {
 	my $self  = shift;
 	my $dn    = shift;
-	my $attrs = \@_;
-	$attrs->[0] = '*' unless scalar @$attrs;
+	my @attrs = (@_) ? @_ : ('*');
 
 	unless ( $dn ) {
 		print "No dn provided.\n";
@@ -944,7 +943,7 @@
 		$s = $self->search({
 			scope  => 'one',
 			vals   => 1,
-			attrs  => $attrs
+			attrs  => \@attrs
 		});
 	}
 	elsif ( $dn =~ /\*/ ) {
@@ -952,7 +951,7 @@
 			scope  => 'one',
 			vals   => 1,
 			filter => $dn,
-			attrs  => $attrs
+			attrs  => \@attrs
 		});
 	}
 	else {
@@ -960,7 +959,7 @@
 		$s = $self->search({
 			base   => $dn,
 			vals   => 1,
-			attrs  => $attrs
+			attrs  => \@attrs
 		});
 	}