From: Jim Meyering Date: Sun, 26 Mar 2006 12:07:34 +0000 (+0000) Subject: (target_directory_operand, movefile): Use new last_component, in place of base_name. X-Git-Tag: v6.0~561 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=00f103b6d1580042aac603c99647758f1da108ce;p=thirdparty%2Fcoreutils.git (target_directory_operand, movefile): Use new last_component, in place of base_name. --- diff --git a/src/mv.c b/src/mv.c index 84d67d79e5..44e935e13c 100644 --- a/src/mv.c +++ b/src/mv.c @@ -148,7 +148,7 @@ cp_option_init (struct cp_options *x) static bool target_directory_operand (char const *file) { - char const *b = base_name (file); + char const *b = last_component (file); size_t blen = strlen (b); bool looks_like_a_dir = (blen == 0 || ISSLASH (b[blen - 1])); struct stat st; @@ -266,7 +266,7 @@ movefile (char *source, char *dest, bool dest_is_dir, if (dest_is_dir) { /* Treat DEST as a directory; build the full filename. */ - char const *src_basename = base_name (source); + char const *src_basename = last_component (source); char *new_dest = file_name_concat (dest, src_basename, NULL); strip_trailing_slashes (new_dest); ok = do_move (source, new_dest, x);