X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fcanonicalize.c;h=822fe6f75ae6640d81b40eda02ba3791d031d6b6;hb=eebfb61f448a11db04a2d5ccd96c1718cca7ef54;hp=6d1bfbc6f8d207f9a35b3703ccd9b9ec22a8e1b3;hpb=cbb957509a65c2a1a7a14e90a35882df286948d1;p=gnulib.git diff --git a/lib/canonicalize.c b/lib/canonicalize.c index 6d1bfbc6f..822fe6f75 100644 --- a/lib/canonicalize.c +++ b/lib/canonicalize.c @@ -1,5 +1,5 @@ /* 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 @@ -14,12 +14,14 @@ 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 #endif +#include "canonicalize.h" + #ifdef STDC_HEADERS # include #else @@ -43,6 +45,7 @@ void free (); #endif #include +#include #include "cycle-check.h" #include "path-concat.h" @@ -54,26 +57,7 @@ void free (); # 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 's symbols. Otherwise, if 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 -# 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 @@ -231,7 +215,7 @@ canonicalize_filename_mode (const char *name, canonicalize_mode_t can_mode) 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)