diff --git a/shelldap b/shelldap index 877cc1b..96d91d2 100755 --- a/shelldap +++ b/shelldap @@ -762,15 +762,15 @@ sub path_to_dn 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 ) {