Mailing List Archive

Bric::Util::Trans::SFTP Escaping
Hey Matt,

I'm refactoring Bric::Util::Trans::SFTP because it doesn't do error-handling properly. But I was wondering about this:

# Grab the base name and escape it.
my $orig_base = $fs->base_name($dest_file);
(my $escaped_base = $orig_base) =~ s/(.)/\\$1/g;

What is the point of the escaped version? Why backslash everything? This wasn't in the old version; look like you added it.

Thanks,

David
Re: Bric::Util::Trans::SFTP Escaping [ In reply to ]
IIRC, that was added in because it was the only way we could get the files to the server.  Feel free to try it without. 


-Matt

On 02 Jul, 2010,at 04:16 PM, "David E. Wheeler" <david@kineticode.com> wrote:

Hey Matt,

I'm refactoring Bric::Util::Trans::SFTP because it doesn't do error-handling properly. But I was wondering about this:

# Grab the base name and escape it.
my $orig_base = $fs->base_name($dest_file);
(my $escaped_base = $orig_base) =~ s/(.)/\\$1/g;

What is the point of the escaped version? Why backslash everything? This wasn't in the old version; look like you added it.

Thanks,

David