emacs-devel
[Top][All Lists]
Advanced

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

Re: $USERPROFILE for $HOME on W32


From: Stefan Monnier
Subject: Re: $USERPROFILE for $HOME on W32
Date: Thu, 25 Nov 2004 18:43:36 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux)

> 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




reply via email to

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