Permalink
Browse files

fix remote username not being propagated to $BCVI_CONF

  • Loading branch information...
1 parent 0123b76 commit e8b7850427632a2d88a552dd3bf1a812346f0689 @grantm committed Jun 4, 2010
Showing with 12 additions and 2 deletions.
  1. +4 −0 Changes
  2. +8 −2 bin/bcvi
View
@@ -1,5 +1,9 @@
Revision history for App-BCVI
+3.00 2010-06-05
+ - Fix bug where remote username was not being propagated to $BCVI_CONF
+ (bug report from Douglas Wilson)
+
3.00 2010-06-03
First version, uploaded to CPAN
Complete rewrite to support plugin API
View
@@ -26,7 +26,7 @@ require 5.008;
package App::BCVI;
-our $VERSION = '3.00';
+our $VERSION = '3.01';
use File::Spec;
use File::Path;
@@ -736,8 +736,12 @@ sub wrap_ssh {
my @orig = @args_in;
my(@args_out, @hosts);
+ my $user = '';
while(@args_in) {
$_ = shift @args_in;
+ if(/^-l(.*)$/) { # extract username if specificed with -l
+ $user = $1 ? $1 : $args_in[0];
+ }
if(/^-(.)(.*)$/) {
push @args_out, $_;
push @args_out, shift @args_in
@@ -750,7 +754,9 @@ sub wrap_ssh {
}
if(@hosts == 1) {
my($target) = @hosts;
- $target =~ s{^.*\@}{};
+ if($user and $target !~ /@/) {
+ $target = $user . '@' . $target;
+ }
my $remote_port = $self->opt('port') || $self->default_port();
my $local_port = $self->listener_port();
$ENV{TERM} = "$ENV{TERM}\n"

0 comments on commit e8b7850

Please sign in to comment.