X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fxstat.in;h=90d1bcb03f584473ee0c5bc11ee1e5f6a14e72b1;hb=93f20861d0ef8383725ceb95772aee532c2c26ff;hp=6e357a8d1eff55065ef0d6e3ed81b42b5689a90e;hpb=e82309f6550680846309fde4cd60e8abf2d1e7f0;p=gnulib.git diff --git a/lib/xstat.in b/lib/xstat.in index 6e357a8d1..90d1bcb03 100644 --- a/lib/xstat.in +++ b/lib/xstat.in @@ -4,7 +4,7 @@ /* Work around the bug in some systems whereby @xstat@ succeeds when given the zero-length file name argument. The @xstat@ from SunOS4.1.4 has this bug. - Copyright (C) 1997-2000 Free Software Foundation, Inc. + Copyright (C) 1997-2002 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 @@ -39,8 +39,13 @@ extern int errno; #ifdef STAT_MACROS_BROKEN # undef S_ISLNK #endif -#if !defined(S_ISLNK) && defined(S_IFLNK) -# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) + +#ifndef S_ISLNK +# ifdef S_IFLNK +# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) +# else +# define S_ISLNK(m) 0 +# endif #endif #ifndef HAVE_DECL_FREE @@ -52,7 +57,7 @@ void free (); char *xmalloc (); -/* lstat works different on Linux and Solaris systems. POSIX (see +/* lstat works differently on Linux and Solaris systems. POSIX (see `pathname resolution' in the glossary) requires that programs like `ls' take into consideration the fact that FILE has a trailing slash when FILE is a symbolic link. On Linux systems, the lstat function already @@ -80,8 +85,7 @@ slash_aware_lstat (const char *file, struct stat *sbuf) /* FILE refers to a symbolic link and the name ends with a slash. Append a `.' to FILE and repeat the lstat call. */ - /* Add one for the `.' we might have to append, and one more - for the trailing NUL. */ + /* Add one for the `.' we'll append, and one more for the trailing NUL. */ new_file = xmalloc (len + 1 + 1); memcpy (new_file, file, len); new_file[len] = '.';