aboutsummaryrefslogtreecommitdiffhomepage
path: root/env.c
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2005-10-25 21:03:52 +1000
committerGravatar axel <axel@liljencrantz.se>2005-10-25 21:03:52 +1000
commitddcb84aa07607bbd274edb89ddc4371d8d7aa27f (patch)
tree018e34432ab3bc2da81e63765405fc1c1ed210dc /env.c
parentd33229324517aff751901d83aa66c6f24eba0bdc (diff)
Fix problem bug breaking completion in commands with multiple subshells
darcs-hash:20051025110352-ac50b-fff319ddcbafb722b9bc3c61aa1b250b290716a5.gz
Diffstat (limited to 'env.c')
-rw-r--r--env.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/env.c b/env.c
index e4688cfb..a58f75f8 100644
--- a/env.c
+++ b/env.c
@@ -388,8 +388,12 @@ void env_init()
pw = getpwuid( getuid() );
- uname = str2wcs( pw->pw_name );
- env_set( L"USER", uname, ENV_GLOBAL | ENV_EXPORT );
+ if( pw )
+ {
+ uname = str2wcs( pw->pw_name );
+ env_set( L"USER", uname, ENV_GLOBAL | ENV_EXPORT );
+ free( uname );
+ }
env_universal_init( env_get( L"FISHD_SOKET_DIR"),
env_get( L"USER" ),
@@ -410,6 +414,8 @@ void env_destroy()
env_pop();
hash_destroy( &env_read_only );
+
+ hash_destroy( &env_electric );
hash_foreach( global, &clear_hash_entry );
hash_destroy( global );