aboutsummaryrefslogtreecommitdiffhomepage
path: root/env.c
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2006-08-28 19:58:40 +1000
committerGravatar axel <axel@liljencrantz.se>2006-08-28 19:58:40 +1000
commitf771fce892394ba877141416d07d930bc7456b2d (patch)
treebfd755fd5e67ae3b962389558dc7be863f7a0ef0 /env.c
parent6522000bf0de69a8a370ae4d9d28a0b305d641ae (diff)
Add a $version variable. Suggested by Martin Bähr
darcs-hash:20060828095840-ac50b-db561647eee1d06785448a4bfc6826eef5aec2b7.gz
Diffstat (limited to 'env.c')
-rw-r--r--env.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/env.c b/env.c
index 22984ace..8a7d2459 100644
--- a/env.c
+++ b/env.c
@@ -457,6 +457,8 @@ void env_init()
char **p;
struct passwd *pw;
wchar_t *uname;
+ wchar_t *version;
+
sb_init( &dyn_var );
b_init( &export_buffer );
@@ -468,6 +470,7 @@ void env_init()
hash_put( &env_read_only, L"status", L"" );
hash_put( &env_read_only, L"history", L"" );
+ hash_put( &env_read_only, L"version", L"" );
hash_put( &env_read_only, L"_", L"" );
hash_put( &env_read_only, L"LINES", L"" );
hash_put( &env_read_only, L"COLUMNS", L"" );
@@ -555,6 +558,13 @@ void env_init()
env_set( L"USER", uname, ENV_GLOBAL | ENV_EXPORT );
free( uname );
}
+
+ /*
+ Set up the version variable
+ */
+ version = str2wcs( PACKAGE_VERSION );
+ env_set( L"version", version, ENV_GLOBAL );
+ free( version );
env_universal_init( env_get( L"FISHD_SOCKET_DIR"),
env_get( L"USER" ),