From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: $USERPROFILE for $HOME on W32 Date: Thu, 25 Nov 2004 18:43:36 -0500 Message-ID: References: <87vfbycsgj.fsf-monnier+emacs@gnu.org> <87mzx69bkn.fsf-monnier+emacs@gnu.org> <01c4d33a$Blat.v2.2.2$dbe68ca0@zahav.net.il> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1101426247 6402 80.91.229.6 (25 Nov 2004 23:44:07 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 25 Nov 2004 23:44:07 +0000 (UTC) Cc: emacs-devel@gnu.org, jasonr@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 26 00:43:58 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 1CXTHJ-0000Vd-00 for ; Fri, 26 Nov 2004 00:43:58 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CXTQW-0008PI-EH for ged-emacs-devel@m.gmane.org; Thu, 25 Nov 2004 18:53:28 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CXTQL-0008PC-EN for emacs-devel@gnu.org; Thu, 25 Nov 2004 18:53:17 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CXTQL-0008P0-1c for emacs-devel@gnu.org; Thu, 25 Nov 2004 18:53:17 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CXTQK-0008Ox-UI for emacs-devel@gnu.org; Thu, 25 Nov 2004 18:53:17 -0500 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CXTH1-0007bl-Rj; Thu, 25 Nov 2004 18:43:39 -0500 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 973F78282BC; Thu, 25 Nov 2004 18:43:39 -0500 (EST) Original-Received: from asado.iro.umontreal.ca (asado.iro.umontreal.ca [132.204.24.84]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id C39F04AC518; Thu, 25 Nov 2004 18:43:36 -0500 (EST) Original-Received: by asado.iro.umontreal.ca (Postfix, from userid 20848) id 9E4678CA69; Thu, 25 Nov 2004 18:43:36 -0500 (EST) Original-To: Eli Zaretskii In-Reply-To: <01c4d33a$Blat.v2.2.2$dbe68ca0@zahav.net.il> (Eli Zaretskii's message of "Fri, 26 Nov 2004 00:04:19 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=0, requis 5) X-MailScanner-From: monnier@iro.umontreal.ca 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:30366 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:30366 > Lisp means, e.g., that temacs will have different ideas about HOME > etc. than the dumped Emacs, which I think might confuse someone some Huh? Of course HOME is different before and after the dump. How could it be otherwise? >> 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. Right. Just as we do it on Unix (except on Unix we only do it for HOME and not for SHELL). > That's too excessive, I think, Doesn't seem to bother people on Unix. > and could be avoided if all the > environment frobbing were done in C. There are many ways to avoid such repetition if it's a problem. Moving the initialization to C is one way among many others, so I don't think it's a particularly compelling reason. Stefan