From f771fce892394ba877141416d07d930bc7456b2d Mon Sep 17 00:00:00 2001 From: axel Date: Mon, 28 Aug 2006 19:58:40 +1000 Subject: [PATCH] =?UTF-8?q?Add=20a=20$version=20variable.=20Suggested=20by?= =?UTF-8?q?=20Martin=20B=C3=A4hr?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit darcs-hash:20060828095840-ac50b-db561647eee1d06785448a4bfc6826eef5aec2b7.gz --- env.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/env.c b/env.c index 22984ace6..8a7d2459e 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" ),