]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Use dir_name, not dirname. Include dirname.h.
authorJim Meyering <jim@meyering.net>
Mon, 7 Dec 1998 06:20:50 +0000 (06:20 +0000)
committerJim Meyering <jim@meyering.net>
Mon, 7 Dec 1998 06:20:50 +0000 (06:20 +0000)
src/copy.c
src/cp.c
src/df.c
src/install.c
src/ln.c

index 3b1acdfe165e8a9f24a581a32768f7b3bb19b369..401ea79ed8c313d67938eac6858d66d45e1b8e49 100644 (file)
@@ -33,6 +33,7 @@
 #include "copy.h"
 #include "cp-hash.h"
 #include "path-concat.h"
+#include "dirname.h"
 
 #define DO_CHOWN(Chown, File, New_uid, New_gid)                                \
   (Chown ((File), (x->myeuid == 0 ? (New_uid) : x->myeuid), (New_gid)) \
@@ -51,7 +52,6 @@ struct dir_list
 int full_write ();
 int euidaccess ();
 int yesno ();
-char *dirname ();
 
 static int copy_internal PARAMS ((const char *src_path, const char *dst_path,
                                  int new_dst, dev_t device,
@@ -700,7 +700,7 @@ copy_internal (const char *src_path, const char *dst_path,
          char *dst_parent;
          int in_current_dir;
 
-         dst_parent = dirname (dst_path);
+         dst_parent = dir_name (dst_path);
          if (dst_parent == NULL)
            error (1, 0, _("virtual memory exhausted"));
 
index d6afbb5b92058e174b7e0a5448daf8ecf9f34700..59541f34028143aae5e7b868d7f982b0f0a468ab 100644 (file)
--- a/src/cp.c
+++ b/src/cp.c
@@ -35,6 +35,7 @@
 #include "cp-hash.h"
 #include "copy.h"
 #include "error.h"
+#include "dirname.h"
 
 #ifndef _POSIX_VERSION
 uid_t geteuid ();
@@ -54,7 +55,6 @@ int stat ();
 int lstat ();
 
 char *base_name ();
-char *dirname ();
 enum backup_type get_version ();
 void strip_trailing_slashes ();
 char *xstrdup ();
@@ -308,7 +308,7 @@ make_path_private (const char *const_dirpath, int src_offset, int mode,
 
   src = dirpath + src_offset;
 
-  tmp_dst_dirname = dirname (dirpath);
+  tmp_dst_dirname = dir_name (dirpath);
   dst_dirname = (char *) alloca (strlen (tmp_dst_dirname) + 1);
   strcpy (dst_dirname, tmp_dst_dirname);
   free (tmp_dst_dirname);
@@ -444,7 +444,7 @@ do_copy (int argc, char **argv, const struct cp_options *x)
          char *arg;
          char *ap;
          char *dst_path;
-         int parent_exists = 1; /* True if dirname (dst_path) exists. */
+         int parent_exists = 1; /* True if dir_name (dst_path) exists. */
          struct dir_attr *attr_list;
          char *arg_in_concat = NULL;
 
@@ -460,7 +460,7 @@ do_copy (int argc, char **argv, const struct cp_options *x)
                error (1, 0, _("virtual memory exhausted"));
 
              /* For --parents, we have to make sure that the directory
-                dirname (dst_path) exists.  We may have to create a few
+                dir_name (dst_path) exists.  We may have to create a few
                 leading directories. */
              parent_exists = !make_path_private (dst_path,
                                                  arg_in_concat - dst_path,
index f6b62f145dcf03ac6b6d56c17125f51edded2034..a036d510b23abdc87623dfb4f8df026d322825b0 100644 (file)
--- a/src/df.c
+++ b/src/df.c
@@ -35,8 +35,8 @@
 #include "closeout.h"
 #include "error.h"
 #include "human.h"
+#include "dirname.h"
 
-char *dirname ();
 void strip_trailing_slashes ();
 char *xstrdup ();
 char *xgetcwd ();
@@ -411,7 +411,7 @@ find_mount_point (const char *file, const struct stat *file_stat)
       char *dir;
 
       strip_trailing_slashes (tmp);
-      dir = dirname (tmp);
+      dir = dir_name (tmp);
       free (tmp);
       rv = chdir (dir);
       free (dir);
index 98c196a4377d467333638921cf65d9244ef132a4..888204d107bb43106c55a687b9ee468d563dd327 100644 (file)
@@ -81,6 +81,7 @@
 #include "path-concat.h"
 #include "cp-hash.h"
 #include "copy.h"
+#include "dirname.h"
 
 #if HAVE_SYS_WAIT_H
 # include <sys/wait.h>
@@ -127,7 +128,6 @@ gid_t getgid ();
 #endif
 
 char *base_name ();
-char *dirname ();
 int full_write ();
 int isdir ();
 enum backup_type get_version ();
@@ -411,7 +411,7 @@ install_file_to_path (const char *from, const char *to,
   char *dest_dir;
   int fail;
 
-  dest_dir = dirname (to);
+  dest_dir = dir_name (to);
 
   /* check to make sure this is a path (not install a b ) */
   if (!STREQ (dest_dir, ".")
index a935796fa3063fc9aae2f3baa9bfbcf1b15fc50f..d15060e856460091f2c4450a4861b09e2de69b49 100644 (file)
--- a/src/ln.c
+++ b/src/ln.c
@@ -30,6 +30,7 @@
 #include "backupfile.h"
 #include "closeout.h"
 #include "error.h"
+#include "dirname.h"
 
 int link ();                   /* Some systems don't declare this anywhere. */
 
@@ -58,7 +59,6 @@ int symlink ();
     while (0)
 
 char *base_name ();
-char *dirname ();
 enum backup_type get_version ();
 int isdir ();
 int yesno ();
@@ -131,8 +131,8 @@ same_name (const char *source, const char *dest)
   struct stat dest_dir_stats;
   char *source_dirname, *dest_dirname;
 
-  source_dirname = dirname (source);
-  dest_dirname = dirname (dest);
+  source_dirname = dir_name (source);
+  dest_dirname = dir_name (dest);
   if (source_dirname == NULL || dest_dirname == NULL)
     error (1, 0, _("virtual memory exhausted"));