From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Keiichiro Nagano (=?ISO-2022-JP?B?GyRCMUpMbjc9MGxPOhsoQg==?=) Newsgroups: gmane.emacs.devel Subject: init_buffer PWD fix Date: Mon, 22 Apr 2002 05:15:17 +0900 Sender: emacs-devel-admin@gnu.org Message-ID: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Trace: main.gmane.org 1019420300 17876 127.0.0.1 (21 Apr 2002 20:18:20 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 21 Apr 2002 20:18:20 +0000 (UTC) Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 16zNmu-0004eD-00 for ; Sun, 21 Apr 2002 22:18:20 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 16zNnH-0007T5-00 for ; Sun, 21 Apr 2002 22:18:43 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16zNmk-0004eE-00; Sun, 21 Apr 2002 16:18:10 -0400 Original-Received: from fw1280219.kitanet.ne.jp ([210.237.128.219] helo=omni-engine.com) by fencepost.gnu.org with smtp (Exim 3.34 #1 (Debian)) id 16zNk0-0004XX-00 for ; Sun, 21 Apr 2002 16:15:21 -0400 Original-Received: from bed.omni-engine.com (localhost [127.0.0.1]) by omni-engine.com (Postfix) with ESMTP id C2EAAE54CC for ; Mon, 22 Apr 2002 05:15:17 +0900 (JST) Original-To: emacs-devel@gnu.org 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) Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.9 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:2962 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:2962 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