add $FISH_VERSION as unexported global variable to complement version

This commit is contained in:
David Adam (zanchey) 2012-11-02 18:36:06 +08:00 committed by ridiculousfish
parent be5fde9e54
commit a10fa3a20b

View file

@ -557,6 +557,7 @@ void env_init(const struct config_paths_t *paths /* or NULL */)
L"COLUMNS", L"COLUMNS",
L"PWD", L"PWD",
L"SHLVL", L"SHLVL",
L"FISH_VERSION",
}; };
for (size_t i=0; i < sizeof ro_keys / sizeof *ro_keys; i++) { for (size_t i=0; i < sizeof ro_keys / sizeof *ro_keys; i++) {
env_read_only.insert(ro_keys[i]); env_read_only.insert(ro_keys[i]);
@ -653,10 +654,11 @@ void env_init(const struct config_paths_t *paths /* or NULL */)
} }
/* /*
Set up the version variable Set up the version variables
*/ */
version = str2wcs( PACKAGE_VERSION ); version = str2wcs( PACKAGE_VERSION );
env_set( L"version", version, ENV_GLOBAL ); env_set( L"version", version, ENV_GLOBAL );
env_set( L"FISH_VERSION", version, ENV_GLOBAL );
free( version ); free( version );
const env_var_t fishd_dir_wstr = env_get_string( L"FISHD_SOCKET_DIR"); const env_var_t fishd_dir_wstr = env_get_string( L"FISHD_SOCKET_DIR");