aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2011-10-19 14:02:36 -0700
committerH. Peter Anvin <hpa@linux.intel.com>2011-10-19 14:02:36 -0700
commit185d3f3d8c72ecaa711deee5be6bf6f4528f1b70 (patch)
tree3d6528ce62d27b07a407f8e8cf452d2cce6571a8
parent7257beafaf81b76fd4f39b11a07a1b3586abb6d2 (diff)
downloadkup-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-xkup5
1 files changed, 3 insertions, 2 deletions
diff --git a/kup b/kup
index e3d3f9d..cdfb8a9 100755
--- a/kup
+++ b/kup
@@ -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;