Subject: | : in path leads to wrong parsing in "_parse_scp_string" |
(happend under 0.12, but seems to exist till today)
_parse_scp_string uses a simple split by : to get the host and path
portion of the string.
This fails in the case where : is a part of the path, for example (a
common case on many cisco routers)
$scp->scp("$host:/nvram:startup-config", $foo)
My quick and dirty proposal for fixing that:
--- Expect.pm.orig Mon May 17 12:47:13 2010
+++ Expect.pm Mon May 17 12:52:13 2010
@@ -258,7 +258,7 @@
}
my $temp = join('',@parts);
- ($host,$dest) = split(/:/,$temp);
+ ($host,$dest) = $temp =~ /([^:]*):(.*)/;
# scp('file','file') syntax, where local to remote is assumed
unless($dest){