diff src/fileio.c @ 373:6240c7796c7a r21-2b2

Import from CVS: tag r21-2b2
author cvs
date Mon, 13 Aug 2007 11:04:06 +0200
parents cc15677e0335
children d883f39b8495
line wrap: on
line diff
--- a/src/fileio.c	Mon Aug 13 11:03:09 2007 +0200
+++ b/src/fileio.c	Mon Aug 13 11:04:06 2007 +0200
@@ -454,13 +454,16 @@
       Bufbyte *res = alloca (MAXPATHLEN + 1);
       if (getdefdir (toupper (*beg) - 'A' + 1, res))
 	{
-	  if (!IS_DIRECTORY_SEP (res[strlen ((char *) res) - 1]))
-	    strcat ((char *) res, "/");
+	  char *c=((char *) res) + strlen ((char *) res);
+	  if (!IS_DIRECTORY_SEP (*c))
+	    {
+	      *c++ = DIRECTORY_SEP;
+	      *c = '\0';
+	    }
 	  beg = res;
 	  p = beg + strlen ((char *) beg);
 	}
     }
-  CORRECT_DIR_SEPS (beg);
 #endif /* WINDOWSNT */
   return make_string (beg, p - beg);
 }
@@ -544,9 +547,6 @@
 	  out[size + 1] = '\0';
 	}
     }
-#ifdef WINDOWSNT
-  CORRECT_DIR_SEPS (out);
-#endif
   return out;
 }
 
@@ -608,9 +608,6 @@
       )
     dst[slen - 1] = 0;
 #endif /* APOLLO */
-#ifdef WINDOWSNT
-  CORRECT_DIR_SEPS (dst);
-#endif /* WINDOWSNT */
   return 1;
 }
 
@@ -2288,7 +2285,7 @@
   if (!NILP (handler))
     RETURN_UNGCPRO (call2 (handler, Qfile_readable_p, abspath));
 
-#ifdef WINDOWSNT
+#if defined(WINDOWSNT) || defined(__CYGWIN32__)
   /* Under MS-DOS and Windows, open does not work for directories.  */
   UNGCPRO;
   if (access (XSTRING_DATA (abspath), 0) == 0)