Fix the uninitialized $path value errors I erroneously introduced on
authorMahlon E. Smith <mahlon@laika.com>
Thu, 10 Jan 2013 18:24:27 -0800
changeset 46 f0616455056d
parent 45 173de72687b2
child 47 bf9d6fa1b1d4
Fix the uninitialized $path value errors I erroneously introduced on 'cd' without an argument.
shelldap
--- a/shelldap	Tue Jan 08 15:57:22 2013 -0800
+++ b/shelldap	Thu Jan 10 18:24:27 2013 -0800
@@ -762,15 +762,15 @@
 	my %flags   = @_;
 	my $curbase = $self->base();
 
+	# support empty 'cd' or 'cd ~' going to root
+	return $conf->{'basedn'} if ! $path || $path eq '~';
+
 	# return current base DN
 	return $curbase if $path eq '.';
 
 	# support 'cd -'
 	return $self->{'previous_base'} if $path eq '-';
 
-	# support empty 'cd' or 'cd ~' going to root
-	return $conf->{'basedn'} if $path eq '~' || ! $path;
-
 	# relative path, upwards
 	#
 	if ( $path =~ /^\.\./o ) {