diff options
author | H. Peter Anvin <hpa@zytor.com> | 2011-09-27 16:13:18 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2011-09-27 16:13:18 -0700 |
commit | 51bf3b73d42500af4d637ab022e65e86323e2173 (patch) | |
tree | 2947f811606a4d8280d4b38d6080353ec120de77 | |
parent | 08482dd0468ff6a5d75439eef128470387e729ea (diff) | |
download | kup-51bf3b73d42500af4d637ab022e65e86323e2173.tar.gz |
Allow the move destination to be a directory name ending in /
-rwxr-xr-x | kup | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -317,6 +317,14 @@ sub cmd_move() if (!is_valid_filename($from)) { die "$0: invalid pathname: $from\n"; } + + if ($to =~ /\/$/) { + # Syntactic sugar: allow specifying a directory only by ending in / + if ($from =~ m:^(.*/|)([^/]+)$:) { + $to .= $2; + } + } + if (!is_valid_filename($to)) { die "$0: invalid pathname: $to\n"; } |