Skip to content

Commit

Permalink
fix remote username not being propagated to $BCVI_CONF
Browse files Browse the repository at this point in the history
  • Loading branch information
grantm committed Jun 4, 2010
1 parent 0123b76 commit e8b7850
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Changes
@@ -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
Expand Down
10 changes: 8 additions & 2 deletions bin/bcvi
Expand Up @@ -26,7 +26,7 @@ require 5.008;

package App::BCVI;

our $VERSION = '3.00';
our $VERSION = '3.01';

use File::Spec;
use File::Path;
Expand Down Expand Up @@ -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
Expand All @@ -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"
Expand Down

0 comments on commit e8b7850

Please sign in to comment.