New module 'unicase/u8-casecmp'.
[pspp] / lib / canonicalize-lgpl.c
index 2ed149bcb0ac9fbb641ed8a8fb59aa18a8f856ce..3aaa310ecd2d0883e6b8e5121e214859d28d1786 100644 (file)
@@ -1,11 +1,11 @@
 /* Return the canonical absolute name of a given file.
-   Copyright (C) 1996-2003, 2005-2007 Free Software Foundation, Inc.
+   Copyright (C) 1996-2003, 2005-2008 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
-   This program is free software; you can redistribute it and/or modify
+   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
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -13,8 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -79,7 +78,7 @@
 # endif
 # define __readlink readlink
   /* On systems without symbolic links, call stat() instead of lstat().  */
-# if !defined S_ISNLK && !HAVE_READLINK
+# if !defined S_ISLNK && !HAVE_READLINK
 #  define lstat stat
 # endif
 #endif
@@ -261,7 +260,7 @@ __realpath (const char *name, char *resolved)
                  goto error;
                }
 
-             n = __readlink (rpath, buf, path_max);
+             n = __readlink (rpath, buf, path_max - 1);
              if (n < 0)
                {
                  int saved_errno = errno;