mirror of
git://git.sv.gnu.org/coreutils.git
synced 2026-04-20 02:36:16 +02:00
* bootstrap.conf (gnulib_modules): Replace xreadlink with
xreadlink-with-size. Add xreadlink. * src/copy.c (copy_internal): Update. * src/ls.c (is_directory): Update. * src/stat.c (print_stat): Update. * src/readlink.c (main): Use the one-argument xreadlink function.
This commit is contained in:
committed by
Jim Meyering
parent
e5dbc71841
commit
f6f2846bd8
@@ -1,3 +1,12 @@
|
||||
2007-02-28 Bruno Haible <bruno@clisp.org>
|
||||
|
||||
* bootstrap.conf (gnulib_modules): Replace xreadlink with
|
||||
xreadlink-with-size. Add xreadlink.
|
||||
* src/copy.c (copy_internal): Update.
|
||||
* src/ls.c (is_directory): Update.
|
||||
* src/stat.c (print_stat): Update.
|
||||
* src/readlink.c (main): Use the one-argument xreadlink function.
|
||||
|
||||
2007-02-28 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* doc/coreutils.texi (Common options): --si outputs "M", not "MB".
|
||||
|
||||
@@ -66,8 +66,8 @@ gnulib_modules="
|
||||
unicodeio unistd-safer unlink-busy unlinkdir unlocked-io
|
||||
uptime userspec utimecmp utimens vasprintf verify version-etc-fsf
|
||||
wcwidth winsz-ioctl winsz-termios xalloc xgetcwd xgethostname
|
||||
xmemcoll xnanosleep xreadlink xstrtod xstrtoimax xstrtol
|
||||
xstrtold xstrtoumax yesno
|
||||
xmemcoll xnanosleep xreadlink xreadlink-with-size xstrtod xstrtoimax
|
||||
xstrtol xstrtold xstrtoumax yesno
|
||||
"
|
||||
|
||||
# Other locale categories that need message catalogs.
|
||||
|
||||
@@ -1720,7 +1720,7 @@ copy_internal (char const *src_name, char const *dst_name,
|
||||
}
|
||||
else if (S_ISLNK (src_mode))
|
||||
{
|
||||
char *src_link_val = xreadlink (src_name, src_sb.st_size);
|
||||
char *src_link_val = xreadlink_with_size (src_name, src_sb.st_size);
|
||||
if (src_link_val == NULL)
|
||||
{
|
||||
error (0, errno, _("cannot read symbolic link %s"), quote (src_name));
|
||||
@@ -1740,7 +1740,8 @@ copy_internal (char const *src_name, char const *dst_name,
|
||||
FIXME: This behavior isn't documented, and seems wrong
|
||||
in some cases, e.g., if the destination symlink has the
|
||||
wrong ownership, permissions, or time stamps. */
|
||||
char *dest_link_val = xreadlink (dst_name, dst_sb.st_size);
|
||||
char *dest_link_val =
|
||||
xreadlink_with_size (dst_name, dst_sb.st_size);
|
||||
if (STREQ (dest_link_val, src_link_val))
|
||||
same_link = true;
|
||||
free (dest_link_val);
|
||||
|
||||
2
src/ls.c
2
src/ls.c
@@ -2798,7 +2798,7 @@ is_directory (const struct fileinfo *f)
|
||||
static void
|
||||
get_link_name (char const *filename, struct fileinfo *f, bool command_line_arg)
|
||||
{
|
||||
f->linkname = xreadlink (filename, f->stat.st_size);
|
||||
f->linkname = xreadlink_with_size (filename, f->stat.st_size);
|
||||
if (f->linkname == NULL)
|
||||
file_failure (command_line_arg, _("cannot read symbolic link %s"),
|
||||
filename);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* readlink -- display value of a symbolic link.
|
||||
Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -159,7 +159,7 @@ main (int argc, char **argv)
|
||||
|
||||
value = (can_mode != -1
|
||||
? canonicalize_filename_mode (fname, can_mode)
|
||||
: xreadlink (fname, 1024));
|
||||
: xreadlink (fname));
|
||||
if (value)
|
||||
{
|
||||
printf ("%s%s", value, (no_newline ? "" : "\n"));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* stat.c -- display file or file system status
|
||||
Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation.
|
||||
Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -497,7 +497,7 @@ print_stat (char *pformat, size_t prefix_len, char m,
|
||||
out_string (pformat, prefix_len, quote (filename));
|
||||
if (S_ISLNK (statbuf->st_mode))
|
||||
{
|
||||
char *linkname = xreadlink (filename, statbuf->st_size);
|
||||
char *linkname = xreadlink_with_size (filename, statbuf->st_size);
|
||||
if (linkname == NULL)
|
||||
{
|
||||
error (0, errno, _("cannot read symbolic link %s"),
|
||||
|
||||
Reference in New Issue
Block a user