This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [ANNOUNCEMENT] Updated: bash-3.0-7


-----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@byu.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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]