X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fxstat.in;h=77c367eb736d7dadfbdf5e40bc54ba85e854b688;hb=d36212cb0a461bc3f063ecbcb1c4d88316eaa397;hp=825ae19b5796ea984ed075acc69404558de659ad;hpb=14f7fd8527011bf559082d2ceabfc7d931aa3920;p=gnulib.git diff --git a/lib/xstat.in b/lib/xstat.in index 825ae19b5..77c367eb7 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-2001 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 @@ -32,6 +32,10 @@ extern int errno; #endif @BEGIN_LSTAT_ONLY@ +#if HAVE_STDLIB_H +# include +#endif + #ifdef STAT_MACROS_BROKEN # undef S_ISLNK #endif @@ -39,9 +43,16 @@ extern int errno; # define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) #endif +#ifndef HAVE_DECL_FREE +"this configure-time declaration test was not run" +#endif +#if !HAVE_DECL_FREE +void free (); +#endif + 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 @@ -69,8 +80,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] = '.';