diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2013-02-11 23:16:50 -0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2013-02-11 23:16:50 -0800 |
commit | 2a7fc9c3a507de45e1aa723068fb373567b869a1 (patch) | |
tree | 638983462e567356b3dbfd227a79adb48d6cc41b /env.cpp | |
parent | be23c0755e898ee3709c4635885342a9c1f77061 (diff) |
Clean up env_var_table_t. Switch from storing var_uni_entry_t* to var_uni_entry_t. Various other cleanups.
Diffstat (limited to 'env.cpp')
-rw-r--r-- | env.cpp | 19 |
1 files changed, 6 insertions, 13 deletions
@@ -1029,13 +1029,6 @@ int env_remove(const wcstring &key, int var_mode) return !erased; } -env_var_t env_var_t::missing_var(void) -{ - env_var_t result(L""); - result.is_missing = true; - return result; -} - const wchar_t *env_var_t::c_str(void) const { assert(! is_missing); @@ -1119,7 +1112,7 @@ env_var_t env_get_string(const wcstring &key) env_universal_barrier(); } - wchar_t *item = env_universal_get(key); + const wchar_t *item = env_universal_get(key); if (!item || (wcscmp(item, ENV_NULL)==0)) { @@ -1135,7 +1128,7 @@ env_var_t env_get_string(const wcstring &key) bool env_exist(const wchar_t *key, int mode) { env_node_t *env; - wchar_t *item=0; + const wchar_t *item = NULL; CHECK(key, false); @@ -1387,9 +1380,9 @@ wcstring_list_t env_get_names(int flags) { wcstring_list_t uni_list; - env_universal_get_names2(uni_list, - show_exported, - show_unexported); + env_universal_get_names(uni_list, + show_exported, + show_unexported); names.insert(uni_list.begin(), uni_list.end()); } @@ -1472,7 +1465,7 @@ static void update_export_array_if_necessary(bool recalc) get_exported(top, vals); wcstring_list_t uni; - env_universal_get_names2(uni, 1, 0); + env_universal_get_names(uni, 1, 0); for (i=0; i<uni.size(); i++) { const wcstring &key = uni.at(i); |