unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* init_buffer PWD fix
@ 2002-04-21 20:15 Keiichiro Nagano
  2002-04-21 23:00 ` Keiichiro Nagano
                   ` (2 more replies)
  0 siblings, 3 replies; 54+ messages in thread
From: Keiichiro Nagano @ 2002-04-21 20:15 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 54+ messages in thread

end of thread, other threads:[~2002-04-25 22:52 UTC | newest]

Thread overview: 54+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-04-21 20:15 init_buffer PWD fix Keiichiro Nagano
2002-04-21 23:00 ` Keiichiro Nagano
2002-04-22  6:18 ` Paul Eggert
2002-04-22  7:20   ` Keiichiro Nagano
2002-04-22 11:15     ` Eli Zaretskii
2002-04-22 21:16     ` Jason Rumney
2002-04-22  7:53   ` Eli Zaretskii
2002-04-22  7:01     ` Paul Eggert
2002-04-22  8:10       ` Eli Zaretskii
2002-04-22  7:22         ` Paul Eggert
2002-04-22 11:14           ` Eli Zaretskii
2002-04-22 23:21             ` Paul Eggert
2002-04-23  6:05               ` Eli Zaretskii
2002-04-22 21:21         ` Jason Rumney
2002-04-23  5:56           ` Eli Zaretskii
2002-04-23  6:14   ` MIYASHITA Hisashi
2002-04-23 11:00     ` Eli Zaretskii
2002-04-24 17:55       ` Richard Stallman
2002-04-24 18:14         ` MIYASHITA Hisashi
2002-04-23 17:45     ` Paul Eggert
2002-04-24  6:52       ` MIYASHITA Hisashi
2002-04-24  7:13         ` Paul Eggert
2002-04-24  7:45           ` MIYASHITA Hisashi
2002-04-24 11:12             ` Eli Zaretskii
2002-04-24 10:30               ` MIYASHITA Hisashi
2002-04-24 16:03                 ` Eli Zaretskii
2002-04-24 17:13                   ` MIYASHITA Hisashi
2002-04-24 18:10                     ` Eli Zaretskii
2002-04-24 18:25                       ` MIYASHITA Hisashi
2002-04-24 19:19                     ` Paul Eggert
2002-04-24 19:41                       ` MIYASHITA Hisashi
2002-04-24 19:59                         ` MIYASHITA Hisashi
2002-04-24 20:21                         ` Paul Eggert
2002-04-24 20:41                           ` MIYASHITA Hisashi
2002-04-24 21:01                             ` Paul Eggert
2002-04-24 21:23                               ` MIYASHITA Hisashi
2002-04-24 21:35                                 ` MIYASHITA Hisashi
2002-04-25 22:52                                 ` Stefan Monnier
2002-04-25  3:42                             ` Eli Zaretskii
2002-04-24 16:47                 ` Paul Eggert
2002-04-24 17:55                   ` MIYASHITA Hisashi
2002-04-24 10:38               ` MIYASHITA Hisashi
2002-04-24 16:08                 ` Eli Zaretskii
2002-04-24 16:10                 ` Eli Zaretskii
2002-04-24  7:55           ` MIYASHITA Hisashi
2002-04-24 11:07           ` Eli Zaretskii
2002-04-24 11:05         ` Eli Zaretskii
2002-04-24 10:31           ` MIYASHITA Hisashi
2002-04-24 16:05             ` Eli Zaretskii
2002-04-22  7:03 ` Eli Zaretskii
2002-04-22  6:49   ` Keiichiro Nagano
2002-04-22  8:01     ` Eli Zaretskii
2002-04-22  8:26       ` Keiichiro Nagano
2002-04-22 11:19         ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).