/* Return the canonical absolute name of a given file.
- Copyright (C) 1996-2004 Free Software Foundation, Inc.
+ Copyright (C) 1996-2005 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
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING.
If not, write to the Free Software Foundation,
- 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
+#include "canonicalize.h"
+
#ifdef STDC_HEADERS
# include <stdlib.h>
#else
#endif
#include <errno.h>
+#include <stddef.h>
#include "cycle-check.h"
#include "path-concat.h"
# define __set_errno(Val) errno = (Val)
#endif
-/* If __PTRDIFF_TYPE__ is
- defined, as with GNU C, use that; that way we don't pollute the
- namespace with <stddef.h>'s symbols. Otherwise, if <stddef.h> is
- available, include it and use ptrdiff_t. In traditional C, long is
- the best that we can do. */
-
-#ifdef __PTRDIFF_TYPE__
-# define PTR_INT_TYPE __PTRDIFF_TYPE__
-#else
-# ifdef HAVE_STDDEF_H
-# include <stddef.h>
-# define PTR_INT_TYPE ptrdiff_t
-# else
-# define PTR_INT_TYPE long
-# endif
-#endif
-
-#include "canonicalize.h"
#include "pathmax.h"
-#include "stat-macros.h"
#include "xreadlink.h"
#if !HAVE_CANONICALIZE_FILE_NAME
if (dest + (end - start) >= rpath_limit)
{
- PTR_INT_TYPE dest_offset = dest - rpath;
+ ptrdiff_t dest_offset = dest - rpath;
size_t new_size = rpath_limit - rpath;
if (end - start + 1 > PATH_MAX)