Fix for wrong sense for determining when an autoloaded function has changed

Addresses some of the complaints in https://github.com/fish-shell/fish-shell/pull/201
This commit is contained in:
ridiculousfish 2012-07-06 15:30:27 -07:00
parent d07e78c59a
commit 11e56456a0
2 changed files with 6 additions and 6 deletions

View file

@ -197,12 +197,12 @@ bool autoload_t::locate_file_and_maybe_load_it( const wcstring &cmd, bool really
if (! func) { if (! func) {
/* Can't use a function that doesn't exist */ /* Can't use a function that doesn't exist */
use_cached = false; use_cached = false;
} else if ( ! allow_stale_functions && is_stale(func)) {
/* Can't use a stale function */
use_cached = false;
} else if (really_load && ! func->is_placeholder && ! func->is_loaded) { } else if (really_load && ! func->is_placeholder && ! func->is_loaded) {
/* Can't use an unloaded function */ /* Can't use an unloaded function */
use_cached = false; use_cached = false;
} else if ( ! allow_stale_functions && is_stale(func)) {
/* Can't use a stale function */
use_cached = false;
} else { } else {
/* I guess we can use it */ /* I guess we can use it */
use_cached = true; use_cached = true;
@ -266,7 +266,7 @@ bool autoload_t::locate_file_and_maybe_load_it( const wcstring &cmd, bool really
autoload_function_t *func = this->get_node(cmd); autoload_function_t *func = this->get_node(cmd);
/* Generate the source if we need to load it */ /* Generate the source if we need to load it */
bool need_to_load_function = really_load && (func == NULL || func->access.mod_time == access.mod_time || ! func->is_loaded); bool need_to_load_function = really_load && (func == NULL || func->access.mod_time != access.mod_time || ! func->is_loaded);
if (need_to_load_function) { if (need_to_load_function) {
/* Generate the script source */ /* Generate the script source */

View file

@ -443,7 +443,7 @@ static void event_fire_internal( const event_t *event )
} }
} }
// debug( 1, L"Event handler fires command '%ls'", (wchar_t *)b->buff ); // debug( 1, L"Event handler fires command '%ls'", buffer.c_str() );
/* /*
Event handlers are not part of the main flow of code, so Event handlers are not part of the main flow of code, so
@ -454,7 +454,7 @@ static void event_fire_internal( const event_t *event )
parser_t &parser = parser_t::principal_parser(); parser_t &parser = parser_t::principal_parser();
parser.push_block( EVENT ); parser.push_block( EVENT );
parser.current_block->state1<const event_t *>() = event; parser.current_block->state1<const event_t *>() = event;
parser.eval( buffer.c_str(), 0, TOP ); parser.eval( buffer, 0, TOP );
parser.pop_block(); parser.pop_block();
proc_pop_interactive(); proc_pop_interactive();
proc_set_last_status( prev_status ); proc_set_last_status( prev_status );