(M17260): Separate U+6CBF, J90-3168 and C1-4E58.
[chise/xemacs-chise.git] / src / realpath.c
index 3af9c93..f81bab6 100644 (file)
@@ -22,25 +22,20 @@ Boston, MA 02111-1307, USA.  */
 
 /* Synched up with: Not in FSF. */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
 
 #include <sys/types.h>
-#if defined(HAVE_UNISTD_H) || defined(STDC_HEADERS)
-#include <unistd.h>
-#endif
 #include <stdio.h>
 #include <string.h>
+#include <errno.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
 #ifdef _POSIX_VERSION
 #include <limits.h>                    /* for PATH_MAX */
 #else
 #include <sys/param.h>                 /* for MAXPATHLEN */
 #endif
-#include <errno.h>
-#ifndef STDC_HEADERS
-extern int errno;
-#endif
 
 #ifdef WINDOWSNT
 #include <direct.h>
@@ -62,19 +57,14 @@ extern int errno;
 
 #define MAX_READLINKS 32
 
-#ifdef __STDC__
-char *xrealpath(const char *path, char resolved_path [])
-#else
-char *xrealpath(path, resolved_path)
-const char *path;
-char resolved_path [];
-#endif
+char *
+xrealpath (const char *path, char resolved_path [])
 {
   char copy_path[PATH_MAX];
   char *new_path = resolved_path;
   char *max_path;
-  int readlinks = 0;
 #ifdef S_IFLNK
+  int readlinks = 0;
   char link_path[PATH_MAX];
   int n;
 #endif
@@ -87,11 +77,11 @@ char resolved_path [];
   /*
   ** In NT we have two different cases:  (1) the path name begins
   ** with a drive letter, e.g., "C:"; and (2) the path name begins
-  ** with just a slash, which roots to the current drive. In the 
+  ** with just a slash, which roots to the current drive. In the
   ** first case we are going to leave things alone, in the second
   ** case we will prepend the drive letter to the given path.
   ** Note: So far in testing, I'm only seeing case #1, even though
-  ** I've tried to get the other cases to happen. 
+  ** I've tried to get the other cases to happen.
   ** August Hill, 31 Aug 1997.
   **
   ** Check for a driver letter...C:/...