diff src/buffer.c @ 163:0132846995bd r20-3b8

Import from CVS: tag r20-3b8
author cvs
date Mon, 13 Aug 2007 09:43:35 +0200
parents 2af401a6ecca
children 85ec50267440
line wrap: on
line diff
--- a/src/buffer.c	Mon Aug 13 09:42:28 2007 +0200
+++ b/src/buffer.c	Mon Aug 13 09:43:35 2007 +0200
@@ -2827,7 +2827,7 @@
 
   Fset_buffer (Fget_buffer_create (QSscratch));
 
-  /* If PWD is accurate, use it instead of calling getwd.  This is faster
+  /* If PWD is accurate, use it instead of calling getcwd.  This is faster
      when PWD is right, and may avoid a fatal error.  */
   if ((pwd = getenv ("PWD")) != 0 && IS_DIRECTORY_SEP (*pwd)
       && stat (pwd, &pwdstat) == 0
@@ -2836,8 +2836,8 @@
       && dotstat.st_dev == pwdstat.st_dev
       && (int) strlen (pwd) < MAXPATHLEN)
     strcpy (buf, pwd);
-  else if (getwd (buf) == 0)
-    fatal ("`getwd' failed: errno %d\n", errno);
+  else if (getcwd (buf, MAXPATHLEN) == NULL)
+    fatal ("`getcwd' failed: %s\n", strerror (errno));
 
 #ifndef VMS
   /* Maybe this should really use some standard subroutine