1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-04-11 22:54:02 +02:00

Use dir_name, not dirname. Include dirname.h.

This commit is contained in:
Jim Meyering
1998-12-07 06:20:50 +00:00
parent f5e9896c18
commit 52dedbfebb
5 changed files with 13 additions and 13 deletions

View 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"));

View File

@@ -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,

View File

@@ -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);

View 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, ".")

View File

@@ -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"));