Reorganizing internal_getlogin()

Christopher Faylor
Tue Jun 11 22:32:00 GMT 2002

On Mon, Jun 10, 2002 at 10:28:12PM -0400, Christopher Faylor wrote:
>On Mon, Jun 10, 2002 at 11:30:51AM -0400, Pierre A. Humblet wrote:
>>Christopher Faylor wrote:
>>> Ok.  I'm in favor of getting rid of sexec in 1.3.11, then.
>>> I'll do that sometime today.
>>Then you can also junk the first argument (token) in _spawnve()
>>and spawn_guts() (FYI).
>Yes, this was one of the things that I've wanted to do for a while.

After a chat with Corinna, I have taken a stab at cleaning up some
of the environment manipulation in internal_getlogin.  I've done this
without bothering spawn_guts too much.

I tried to keep most of the logic the same but a couple of things
bothered me in internal_getlogin.  They were probably there for a
good reason, but I changed them anyway.

One thing that I changed was to not query for a user name if you've
already gotten the user name from GetUserName.  I also changed the HOME
and HOMEPATH manipulation slightly.  If there were reasons for the way
things were, then please revert my changes and check in a comment
explaining why you have to call GetUserName and then overwrite what it
has discovered a few lines later.

I probably introduced other gratuitous formatting changes as I careened
around, too.  Hopefully Corinna will tell me if I did anything

The bottom line is that all (most?) user-related environment variables
are only set when they need to be set and are not calculated or set at
all when a known cygwin process is about to be run.  UNIX doesn't know
about HOMEPATH or HOMEDRIVE so there is no reason to assume that a
"native" cygwin process needs this updated info, either.

There's probably more cleanup that can be done.  If so, let's discuss

<time passes>

Oops!  I just realized that I screwed up posix conversion in the new
code.  Oh well.  That something to fix tomorrow.  Until then CVS is
officially broken.


More information about the Cygwin-patches mailing list