diff options
-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); } |