emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

init_buffer PWD fix


From: 永野圭一郎
Subject: init_buffer PWD fix
Date: Mon, 22 Apr 2002 05:15:17 +0900
User-agent: Wanderlust/2.9.9 (Unchained Melody) EMY/1.13.9 (Art is long, life is short) LIMIT/1.14.7 (Fujiidera) APEL/10.3 Emacs/21.2.50 (i686-pc-linux-gnu) MULE/5.0 (SAKAKI)

Dear all,

init_buffer uses environmental variable PWD to identify current
working directory.  I think we should not use it on Windows.  On
Windows with Cygwin, PWD is unreliable and confusing, because

* Cygwin bash treats it
* Cygwin sh (ash) doesnot
* to say nothing of command.com, cmd.exe, nmake.exe and so on

How do you think?

-- 
Keiichiro Nagano



Index: buffer.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/buffer.c,v
retrieving revision 1.381
diff -u -u -r1.381 buffer.c
--- buffer.c       16 Apr 2002 07:34:36 -0000   1.381
+++ buffer.c       21 Apr 2002 20:13:58 -0000
@@ -4973,6 +4973,7 @@
   if (NILP (buffer_defaults.enable_multibyte_characters))
     Fset_buffer_multibyte (Qnil);
 
+#ifndef WINDOWSNT
   /* If PWD is accurate, use it instead of calling getwd.  This is faster
      when PWD is right, and may avoid a fatal error.  */
   if ((pwd = getenv ("PWD")) != 0
@@ -4990,6 +4991,13 @@
   else if (getwd (buf) == 0)
     fatal ("`getwd' failed: %s\n", buf);
 #endif
+#else /* not WINDOWSNT */
+  /* We do not use PWD on Windows because it's unreliable and
+     confusing (Cygwin bash treats it, Cygwin sh (ash) doesnot, to say
+     nothing of command.com, cmd.exe, nmake.exe and so on) */
+  if (getwd (buf) == 0)
+    fatal ("`getwd' failed: %s\n", buf);
+#endif /* not WINDOWSNT */
 
 #ifndef VMS
   /* Maybe this should really use some standard subroutine



reply via email to

[Prev in Thread] Current Thread [Next in Thread]