From 3a26d89b6d54e0b44457a788e5126c1ef2eee24b Mon Sep 17 00:00:00 2001 From: William Haddon Date: Sun, 27 Oct 2019 21:01:43 -0400 Subject: cp: treat a directory name with a slash at the end the same as one without a slash --- toys/posix/cp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'toys/posix') 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); -- cgit v1.2.3