Bash-4.3 distribution sources and documentation
[platform/upstream/bash.git] / lib / sh / pathcanon.c
index 8892954..f19bd55 100644 (file)
@@ -1,27 +1,27 @@
-/* pathcanon.c -- Canonicalize and manipulate pathnames. */
+/* pathcanon.c -- canonicalize and manipulate pathnames. */
 
 /* Copyright (C) 2000 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
-   Bash 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.
+   Bash 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 3 of the License, or
+   (at your option) any later version.
 
-   Bash is distributed in the hope that it will be useful, but WITHOUT ANY
-   WARRANTY; without even the implied warranty of MERCHANTABILITY or
-   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-   for more details.
+   Bash is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-   You should have received a copy of the GNU General Public License along
-   with Bash; see the file COPYING.  If not, write to the Free Software
-   Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+   You should have received a copy of the GNU General Public License
+   along with Bash.  If not, see <http://www.gnu.org/licenses/>.
+*/
 
 #include <config.h>
 
 #include <bashtypes.h>
-#ifndef _MINIX
+#if defined (HAVE_SYS_PARAM_H)
 #  include <sys/param.h>
 #endif
 #include <posixstat.h>
@@ -75,10 +75,11 @@ static int
 _path_isdir (path)
      char *path;
 {
-  int l, x;
+  int l;
   struct stat sb;
 
   /* This should leave errno set to the correct value. */
+  errno = 0;
   l = stat (path, &sb) == 0 && S_ISDIR (sb.st_mode);
 #if defined (__CYGWIN__)
   if (l == 0)