+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).
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);
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);
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);
&& 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;
}
program_name,
S_ISDIR (statp->st_mode) ? "directory " : "",
pathname,
- statp->st_mode & 07777);
+ (unsigned int) (statp->st_mode & 07777));
if (!yesno ())
return 1;
}
{
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;
}