diff options
author | H. Peter Anvin <hpa@linux.intel.com> | 2011-10-19 14:02:36 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2011-10-19 14:02:36 -0700 |
commit | 185d3f3d8c72ecaa711deee5be6bf6f4528f1b70 (patch) | |
tree | 3d6528ce62d27b07a407f8e8cf452d2cce6571a8 | |
parent | 7257beafaf81b76fd4f39b11a07a1b3586abb6d2 (diff) | |
download | kup-185d3f3d8c72ecaa711deee5be6bf6f4528f1b70.tar.gz |
kup: use File::Spec->splitpath() to get the basename
Use File::Spec->splitpath() to obtain the basename for the put
command; this should make this portion of the script at least work for
non-Unix clients.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
-rwxr-xr-x | kup | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -19,6 +19,7 @@ use strict; use warnings; use bytes; use Encode qw(encode decode); +use File::Spec; my $blksiz = 1024*1024; @@ -431,8 +432,8 @@ sub cmd_put() cat_file('DATA', $file, undef); # Get the local filename without directory - $file =~ m:^(|.*/)([^/]+)$:; - $file_tail = $2; + my($vol, $dir); + ($vol, $dir, $file_tail) = File::Spec->splitpath($file); } my $sign = shift @args; |