delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/07/08/00:00:44

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <42CDF9C9.6080207@byu.net>
Date: Thu, 07 Jul 2005 21:58:01 -0600
From: Eric Blake <ebb9 AT byu DOT net>
User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
MIME-Version: 1.0
To: "Jon A. Lambert" <jlsysinc AT alltel DOT net>
CC: Cygwin Mail List <cygwin AT cygwin DOT com>
Subject: Re: [ANNOUNCEMENT] Updated: bash-3.0-7
References: <cygwin DOT 42CD34A0 DOT 5020509 AT byu DOT net> <005301c5831d$04a10980$0200000a AT agamemnon> <001101c58332$5ae5f2f0$0200000a AT agamemnon> <003f01c58342$9b74a400$0200000a AT agamemnon>
In-Reply-To: <003f01c58342$9b74a400$0200000a@agamemnon>
X-IsSubscribed: yes

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Jon A. Lambert on 7/7/2005 4:24 PM:
> I solved the problem. 
> My orignal cygwin.bat file contained:
> SET HOME=c:\cygwin\home
> My profile conatined:
> set HOME=\home\$USER
> 
> This used to work just fine in bash-2.  Doesn't work in bash-3.

Well, there is still something here that bothers me - the fact that the
expansion for ~ is being cached:

$ /bin/sh  # the dynamically linked, stripped, cygwin copy
$ echo $HOME
/home/eblake
$ echo $HOME ~
/home/eblake /home/eblake
$ HOME=/tmp
$ echo $HOME ~
/tmp /home/eblake

Whereas:

$ /usr/local/bin/bash # my statically linked full-debugging copy
$ echo $HOME
/home/eblake
$ echo $HOME ~
/home/eblake /home/eblake
$ HOME=/tmp
$ echo $HOME ~
/tmp /tmp

I also know that bash maintains its own environment, bypassing getenv()
and putenv() for speed.  So, I'm guessing that statically, bash's inline
copy of readline reads the same environment for $HOME through a hook (see
/usr/src/bash-3.0/lib/tilde/tilde.c, sh_get_env_value()), but dynamically,
libreadline6 falls through to raw getenv() and is unable to see the
updates to the environment, seeing only what was in the environment at
startup.  This does not sound like a pleasant bug to fix, since I don't
maintain the libreadline6 to see where it is failing to call bash's hooks
to grab the correct version of the environment.

> Now everything works as it gets it from etc/passwd.
> so nevermind..   :-)

I'm glad your workaround fixed it.  NOTE to other readers - bash-3.0-7
does not properly update tilde-expansion when $HOME is changed after login.

- --
Life is short - so eat dessert first!

Eric Blake             ebb9 AT byu DOT net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCzfnJ84KuGfSFAYARAmXMAJ0RCL12WnolPsXqWPgD6Sa0ppbEoQCgmPAX
9y4aS+pPBm5fIBmFQQqOEFA=
=mHjv
-----END PGP SIGNATURE-----

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019