diff options
author | Jim Meyering <jim@meyering.net> | 1995-05-13 02:21:40 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1995-05-13 02:21:40 +0000 |
commit | 7108d098aef7325aa43c639958b26ced5d2243eb (patch) | |
tree | 72b9ba42498d0b1ee198f554d2ae78e0e74dca40 /src | |
parent | 63c91c859ff0ad68a35f9c5a365ccfcb396d3245 (diff) | |
download | coreutils-7108d098aef7325aa43c639958b26ced5d2243eb.tar.xz |
(movefile): Remove a single trailing slash from destdir before concatenating
with `/' and filename for `ok to overwrite...' message.
Diffstat (limited to 'src')
-rw-r--r-- | src/mv.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -227,6 +227,9 @@ movefile (source, dest) char *new_dest; base = basename (source); + /* Remove a (single) trailing slash if there is at least one. */ + if (dest[strlen (dest) - 1] == '/') + dest[strlen (dest) - 1] = '\0'; new_dest = (char *) alloca (strlen (dest) + 1 + strlen (base) + 1); stpcpy (stpcpy (stpcpy (new_dest, dest), "/"), base); return do_move (source, new_dest); |