diff options
author | William Haddon <william@haddonthethird.net> | 2019-10-27 21:01:43 -0400 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2019-10-28 16:45:43 -0500 |
commit | 3a26d89b6d54e0b44457a788e5126c1ef2eee24b (patch) | |
tree | e9081a88683bbb13d894a7dc36f212b07961bf08 /toys | |
parent | b39584e7048a44889ead0421dac7a7aae7e0a61a (diff) | |
download | toybox-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')
-rw-r--r-- | toys/posix/cp.c | 6 |
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); |