From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Eli Zaretskii" Newsgroups: gmane.emacs.devel Subject: Re: $USERPROFILE for $HOME on W32 Date: Fri, 26 Nov 2004 00:04:19 +0200 Message-ID: <01c4d33a$Blat.v2.2.2$dbe68ca0@zahav.net.il> References: <87vfbycsgj.fsf-monnier+emacs@gnu.org> <87mzx69bkn.fsf-monnier+emacs@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: deer.gmane.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7BIT X-Trace: sea.gmane.org 1101420594 1713 80.91.229.6 (25 Nov 2004 22:09:54 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 25 Nov 2004 22:09:54 +0000 (UTC) Cc: emacs-devel@gnu.org, jasonr@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 25 23:09:44 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CXRo7-0004HZ-00 for ; Thu, 25 Nov 2004 23:09:44 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CXRxK-0007EH-VJ for ged-emacs-devel@m.gmane.org; Thu, 25 Nov 2004 17:19:14 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CXRvy-0006XJ-Vd for emacs-devel@gnu.org; Thu, 25 Nov 2004 17:17:51 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CXRvt-0006Vf-A5 for emacs-devel@gnu.org; Thu, 25 Nov 2004 17:17:47 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CXRvs-0006UW-8t for emacs-devel@gnu.org; Thu, 25 Nov 2004 17:17:44 -0500 Original-Received: from [192.114.186.24] (helo=legolas.inter.net.il) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CXRln-0004Vt-Tu; Thu, 25 Nov 2004 17:07:20 -0500 Original-Received: from zaretski ([80.230.155.194]) by legolas.inter.net.il (MOS 3.5.5-GR) with ESMTP id DET39541 (AUTH halo1); Fri, 26 Nov 2004 00:07:13 +0200 (IST) Original-To: Stefan Monnier X-Mailer: emacs 21.3.50 (via feedmail 8 I) and Blat ver 2.2.2 In-reply-to: <87mzx69bkn.fsf-monnier+emacs@gnu.org> (message from Stefan Monnier on Thu, 25 Nov 2004 11:00:39 -0500) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:30362 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:30362 > From: Stefan Monnier > Date: Thu, 25 Nov 2004 11:00:39 -0500 > Cc: emacs-devel@gnu.org > > Here is a new patch. Could people try it out and tell me if it works? > And tell me how to fix it I still think, like Jason, that all the environment variables frobbing on w32 should be in w32.c:init_environment, not in Lisp. Moving it to Lisp means, e.g., that temacs will have different ideas about HOME etc. than the dumped Emacs, which I think might confuse someone some day. See below for another reason. > getpwuid (int uid) > { > if (uid == the_passwd.pw_uid) > - return &the_passwd; > + { > + /* Set dir and shell from environment variables. */ > + strcpy (the_passwd.pw_dir, getenv ("HOME")); > + strcpy (the_passwd.pw_shell, getenv ("SHELL")); > + return &the_passwd; > + } > return NULL; > } This change means that we run this code every time getpwuid is called. That's too excessive, I think, and could be avoided if all the environment frobbing were done in C.