]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
merge with 3.8.4e
authorJim Meyering <jim@meyering.net>
Wed, 13 Oct 1993 22:30:38 +0000 (22:30 +0000)
committerJim Meyering <jim@meyering.net>
Wed, 13 Oct 1993 22:30:38 +0000 (22:30 +0000)
old/fileutils/ChangeLog
src/cp.c
src/ls.c
src/mv.c
src/rm.c

index d1d7c3ca75856f050cce9744aa90da807e45f4fc..387a9e06537da62fba54cd1ed7a1835fa0d16732 100644 (file)
@@ -1,3 +1,9 @@
+Wed Oct 13 10:30:40 1993  Jim Meyering  (meyering@comco.com)
+
+       * cp.c (copy), ls.c (get_link_name): Complete Aug 27 change so
+       that we use PATH_MAX + 1 rather than sizeof(char*) as size of
+       buffer in readlink call.  This was causing spurious errors.
+
 Sun Oct 10 13:38:54 1993  Jim Meyering  (meyering@comco.com)
 
        * src/Makefile.in (dist): Depend on $(DISTFILES).
index 5d88f99aa13564e799a9515e40573997dee0a9ad..4fca2c3f9f1e6d623b8a07c059a55ea01ba3e429 100644 (file)
--- a/src/cp.c
+++ b/src/cp.c
@@ -565,7 +565,8 @@ copy (src_path, dst_path, new_dst, device, ancestors)
                  if (eaccess_stat (&dst_sb, W_OK) != 0)
                    fprintf (stderr,
                             "%s: overwrite `%s', overriding mode %04o? ",
-                            program_name, dst_path, dst_sb.st_mode & 07777);
+                            program_name, dst_path,
+                            (unsigned int) (dst_sb.st_mode & 07777));
                  else
                    fprintf (stderr, "%s: overwrite `%s'? ",
                             program_name, dst_path);
@@ -765,7 +766,7 @@ copy (src_path, dst_path, new_dst, device, ancestors)
       int link_size;
 
       link_val = (char *) alloca (PATH_MAX + 2);
-      link_size = readlink (src_path, link_val, sizeof (link_val) - 1);
+      link_size = readlink (src_path, link_val, PATH_MAX + 1);
       if (link_size < 0)
        {
          error (0, errno, "cannot read symbolic link `%s'", src_path);
index 302c8ad4f3ffd9e0c5edcbbcd5ddd6c91b972b40..e42d423c2796a458c4a03a7cacc5613e1b4da5c0 100644 (file)
--- a/src/ls.c
+++ b/src/ls.c
@@ -1094,7 +1094,7 @@ get_link_name (filename, f)
   linkbuf = (char *) alloca (PATH_MAX + 2);
   /* Some automounters give incorrect st_size for mount points.
      I can't think of a good workaround for it, though.  */
-  linksize = readlink (filename, linkbuf, sizeof (linkbuf) - 1);
+  linksize = readlink (filename, linkbuf, PATH_MAX + 1);
   if (linksize < 0)
     {
       error (0, errno, "%s", filename);
index 9b8cd37bcc5e53c7a5e5d131dcf4fa01233dd765..1e858856b9d7e0e6a12050e492baebf2b5cfbb66 100644 (file)
--- a/src/mv.c
+++ b/src/mv.c
@@ -280,7 +280,8 @@ do_move (source, dest)
          && eaccess_stat (&dest_stats, W_OK))
        {
          fprintf (stderr, "%s: replace `%s', overriding mode %04o? ",
-                  program_name, dest, dest_stats.st_mode & 07777);
+                  program_name, dest,
+                  (unsigned int) (dest_stats.st_mode & 07777));
          if (!yesno ())
            return 0;
        }
index acb0e8259e0fa39563cd01c6d8223d1255b16674..b7227fad111f8f7b46af0afd1c91001842435775 100644 (file)
--- a/src/rm.c
+++ b/src/rm.c
@@ -238,7 +238,7 @@ remove_file (statp)
               program_name,
               S_ISDIR (statp->st_mode) ? "directory " : "",
               pathname,
-              statp->st_mode & 07777);
+              (unsigned int) (statp->st_mode & 07777));
       if (!yesno ())
        return 1;
     }
@@ -284,7 +284,8 @@ remove_dir (statp)
     {
       fprintf (stderr,
               "%s: descend directory `%s', overriding mode %04o? ",
-              program_name, pathname, statp->st_mode & 07777);
+              program_name, pathname,
+              (unsigned int) (statp->st_mode & 07777));
       if (!yesno ())
        return 1;
     }