diff options
author | 2012-03-26 01:21:10 -0700 | |
---|---|---|
committer | 2012-03-26 01:21:10 -0700 | |
commit | 0bc644abf06d1cf903ed7bf59302894f80d18971 (patch) | |
tree | da229cd4505d34800af22e10c8f61d380d6a88b3 /env.cpp | |
parent | 31b7d076b7bff8d7bb81e6a1fff58755b7baa10b (diff) |
Fix lots of bugs related to the static analyzer
Improved how screen.cpp interacts with output_set_writer()
Diffstat (limited to 'env.cpp')
-rw-r--r-- | env.cpp | 21 |
1 files changed, 6 insertions, 15 deletions
@@ -708,15 +708,12 @@ void env_destroy() */ static env_node_t *env_get_node( const wcstring &key ) { - var_entry_t* res = NULL; env_node_t *env = top; - - - while( env != 0 ) + while( env != NULL ) { if ( env->env.find( key ) != env->env.end() ) { - return env; + break; } if( env->new_scope ) @@ -728,8 +725,7 @@ static env_node_t *env_get_node( const wcstring &key ) env = env->next; } } - - return 0; + return env; } int env_set(const wchar_t *key, const wchar_t *val, int var_mode) @@ -817,15 +813,10 @@ int env_set(const wchar_t *key, const wchar_t *val, int var_mode) node = env_get_node( key ); if( node ) { - var_table_t::iterator result = node->env.find(key); - if ( result != node->env.end() ) { - e = result->second; - } - else { - e = NULL; - } - + assert(result != node->env.end()); + e = result->second; + if( e->exportv ) { has_changed_new = true; |