mirror of https://github.com/digint/btrbk
btrbk: bugfix: handle corner case: url="ssh://my.host" (without trailing slash)
As we allow <url> to be specified as "<hostname>:<directory>", an URL "ssh://my.host" (without trailing slash) was parsed as hostname="ssh", directory="/my.host".pull/245/head
parent
c2022a5b2f
commit
669a34357a
7
btrbk
7
btrbk
|
@ -3145,8 +3145,11 @@ sub check_url($;@)
|
|||
my %opts = @_;
|
||||
my $url_prefix = "";
|
||||
|
||||
if($url =~ s/^(ssh:\/\/($ip_addr_match|$host_name_match))\//\//) {
|
||||
$url_prefix = $1;
|
||||
if($url =~ /^ssh:\/\//) {
|
||||
if($url =~ s/^(ssh:\/\/($ip_addr_match|$host_name_match))\//\//) {
|
||||
$url_prefix = $1;
|
||||
}
|
||||
# if no match, treat it as file and let check_file() print errors
|
||||
}
|
||||
elsif($url =~ s/^($ip_addr_match|$host_name_match)://) {
|
||||
# convert "my.host.com:/my/path" to ssh url
|
||||
|
|
Loading…
Reference in New Issue