aboutsummaryrefslogtreecommitdiff
path: root/toys/posix
diff options
context:
space:
mode:
authorWilliam Haddon <william@haddonthethird.net>2019-10-27 21:01:43 -0400
committerRob Landley <rob@landley.net>2019-10-28 16:45:43 -0500
commit3a26d89b6d54e0b44457a788e5126c1ef2eee24b (patch)
treee9081a88683bbb13d894a7dc36f212b07961bf08 /toys/posix
parentb39584e7048a44889ead0421dac7a7aae7e0a61a (diff)
downloadtoybox-3a26d89b6d54e0b44457a788e5126c1ef2eee24b.tar.gz
cp: treat a directory name with a slash at the end the same as one without a slash
Diffstat (limited to 'toys/posix')
-rw-r--r--toys/posix/cp.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/toys/posix/cp.c b/toys/posix/cp.c
index d84b55ef..f6ffaf10 100644
--- a/toys/posix/cp.c
+++ b/toys/posix/cp.c
@@ -404,10 +404,8 @@ void cp_main(void)
char *src = toys.optargs[i], *trail = src;
int rc = 1;
- if (CFG_MV && toys.which->name[0] == 'm') {
- while (*++trail);
- if (*--trail == '/') *trail = 0;
- }
+ while (*++trail);
+ if (*--trail == '/') *trail = 0;
if (destdir) {
char *s = FLAG(D) ? dirname(src) : getbasename(src);