diff options
author | Jim Meyering <jim@meyering.net> | 2002-11-17 09:41:34 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2002-11-17 09:41:34 +0000 |
commit | 47161ee7d5ab4fe8977bcb2fb24d0b708b83ec27 (patch) | |
tree | d28835f40e913f2185b1ee07fc4b4dcadea325fe | |
parent | f5c148c983b39620fd1f1666fee97262ad127bed (diff) | |
download | coreutils-47161ee7d5ab4fe8977bcb2fb24d0b708b83ec27.tar.xz |
(movefile): Don't remove trailing slashes from SOURCE.
-rw-r--r-- | src/mv.c | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -284,14 +284,11 @@ movefile (char *source, char *dest, int dest_is_dir, if (dest_is_dir || (dest_had_trailing_slash && !is_real_dir (source))) { /* DEST is a directory; build full target filename. */ - char *src_basename; - char *new_dest; - - strip_trailing_slashes (source); - src_basename = base_name (source); - new_dest = path_concat (dest, src_basename, NULL); + char const *src_basename = base_name (source); + char *new_dest = path_concat (dest, src_basename, NULL); if (new_dest == NULL) xalloc_die (); + strip_trailing_slashes (new_dest); fail = do_move (source, new_dest, x); free (new_dest); } |