]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Use base_name, not basename.
authorJim Meyering <jim@meyering.net>
Tue, 27 May 1997 11:04:41 +0000 (11:04 +0000)
committerJim Meyering <jim@meyering.net>
Tue, 27 May 1997 11:04:41 +0000 (11:04 +0000)
src/dircolors.c
src/install.c
src/ln.c
src/mv.c
src/rm.c

index 56bd35978a8a0469eb573e6101f80107c6044a6f..f3a4808094a052a15eb8a1788eb2ca7cc5df94e4 100644 (file)
@@ -1,5 +1,5 @@
 /* dircolors - output commands to set the LS_COLOR environment variable
-   Copyright (C) 1994, 1995 H. Peter Anvin
+   Copyright (C) 1994, 1995, 1997 H. Peter Anvin
    Copyright (C) 96, 1997 Free Software Foundation, Inc.
 
 This program is free software; you can redistribute it and/or modify
@@ -40,7 +40,7 @@ void free ();
 #endif
 
 char *xmalloc ();
-char *basename ();
+char *base_name ();
 char *strndup();
 
 enum Shell_syntax
@@ -145,7 +145,7 @@ guess_shell_syntax (void)
   if (shell == NULL || *shell == '\0')
     return SHELL_SYNTAX_UNKNOWN;
 
-  shell = basename (shell);
+  shell = base_name (shell);
 
   if (STREQ (shell, "csh") || STREQ (shell, "tcsh"))
     return SHELL_SYNTAX_C;
index ddc91242762d99e51976dc87ab7cdc11987a1cab..eb8059dae7cef3ddb7da9d457556a267f7afeb0f 100644 (file)
@@ -114,7 +114,7 @@ gid_t getgid ();
                                                    * BITSPERBYTE - 1)))))
 #endif
 
-char *basename ();
+char *base_name ();
 char *stpcpy ();
 char *xmalloc ();
 int safe_read ();
@@ -338,7 +338,7 @@ install_file_in_dir (char *from, char *to_dir)
   char *to;
   int ret;
 
-  from_base = basename (from);
+  from_base = base_name (from);
   to = xmalloc ((unsigned) (strlen (to_dir) + strlen (from_base) + 2));
   stpcpy (stpcpy (stpcpy (to, to_dir), "/"), from_base);
   ret = install_file_in_file (from, to);
index a4966ad9ddb74fd51395b7e6f5588c29b890ff1b..492d4598a678fea83ff925989a42d2c49eaf818a 100644 (file)
--- a/src/ln.c
+++ b/src/ln.c
@@ -48,7 +48,7 @@ int symlink ();
        tmp_source = (char *) alloca (strlen ((source)) + 1);           \
        strcpy (tmp_source, (source));                                  \
        strip_trailing_slashes (tmp_source);                            \
-       source_base = basename (tmp_source);                            \
+       source_base = base_name (tmp_source);                           \
                                                                        \
        (new_dest) = (char *) alloca (strlen ((dest)) + 1               \
                                      + strlen (source_base) + 1);      \
@@ -56,7 +56,7 @@ int symlink ();
       }                                                                        \
     while (0)
 
-char *basename ();
+char *base_name ();
 char *dirname ();
 enum backup_type get_version ();
 int isdir ();
@@ -146,7 +146,7 @@ same_name (const char *source, const char *dest)
 
   return (source_dir_stats.st_dev == dest_dir_stats.st_dev
          && source_dir_stats.st_ino == dest_dir_stats.st_ino
-         && STREQ (basename (source), basename (dest)));
+         && STREQ (base_name (source), base_name (dest)));
 }
 
 /* Make a link DEST to the (usually) existing file SOURCE.
@@ -216,7 +216,7 @@ do_link (const char *source, const char *dest)
 
   /* If the destination is a directory or (it is a symlink to a directory
      and the user has not specified --no-dereference), then form the
-     actual destination name by appending basename (source) to the
+     actual destination name by appending base_name (source) to the
      specified destination directory.  */
   if ((lstat_status == 0
        && S_ISDIR (dest_stats.st_mode))
index 1979c65ca812d1bca994c8b384d9e5d0b5760f6b..7acb9ce174059601ac57642fad5cad52de748017 100644 (file)
--- a/src/mv.c
+++ b/src/mv.c
@@ -59,7 +59,7 @@
 uid_t geteuid ();
 #endif
 
-char *basename ();
+char *base_name ();
 enum backup_type get_version ();
 int isdir ();
 int yesno ();
@@ -357,7 +357,7 @@ movefile (const char *source, const char *dest)
       char *new_dest;
       int fail;
 
-      base = basename (source);
+      base = base_name (source);
       new_dest = path_concat (dest, base, NULL);
       if (new_dest == NULL)
        error (1, 0, _("virtual memory exhausted"));
index 641ec1411589e1390e2938741e8a968c04de76ef..4f226426f622f157e4cabe815ea9c7f68090315e 100644 (file)
--- a/src/rm.c
+++ b/src/rm.c
@@ -42,7 +42,7 @@ struct pathstack
   ino_t inum;
 };
 
-char *basename ();
+char *base_name ();
 char *stpcpy ();
 char *xmalloc ();
 char *xrealloc ();
@@ -205,7 +205,7 @@ static int
 rm (void)
 {
   struct stat path_stats;
-  char *base = basename (pathname);
+  char *base = base_name (pathname);
 
   if (base[0] == '.' && (base[1] == '\0'
                             || (base[1] == '.' && base[2] == '\0')))