]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(ASSIGN_STRDUPA): Remove macro definition.
authorJim Meyering <jim@meyering.net>
Sun, 23 Jul 2000 10:52:05 +0000 (10:52 +0000)
committerJim Meyering <jim@meyering.net>
Sun, 23 Jul 2000 10:52:05 +0000 (10:52 +0000)
src/remove.c

index 2886066d84a0cd20ce1d0ab48ea38a60470ca12e..6b8614fac0dca8fea2378cbc604f14786cd00a3a 100644 (file)
@@ -70,21 +70,6 @@ int rpl_lstat PARAMS((const char *, struct stat *));
 # define S_ISLNK(Mode) 0
 #endif
 
-#if defined strdupa
-# define ASSIGN_STRDUPA(DEST, S)               \
-  do { DEST = strdupa(S); } while (0)
-#else
-# define ASSIGN_STRDUPA(DEST, S)               \
-  do                                           \
-    {                                          \
-      const char *s_ = (S);                    \
-      size_t len_ = strlen (s_) + 1;           \
-      char *tmp_dest_ = (char *) alloca (len_);        \
-      DEST = memcpy (tmp_dest_, (s_), len_);   \
-    }                                          \
-  while (0)
-#endif
-
 /* Initial capacity of per-directory hash table of entries that have
    been processed but not been deleted.  */
 #define HT_INITIAL_CAPACITY 13
@@ -838,6 +823,8 @@ rm (struct File_spec *fs, int user_specified_name, const struct rm_options *x)
 
   if (user_specified_name)
     {
+      /* CAUTION: this use of base_name works only because any
+        trailing slashes in fs->filename have already been removed. */
       char *base = base_name (fs->filename);
 
       if (DOT_OR_DOTDOT (base))