diff --git a/common.c b/common.c index d222d2bcd..054b5741c 100644 --- a/common.c +++ b/common.c @@ -115,8 +115,6 @@ void common_destroy() } } - - wchar_t **list_to_char_arr( array_list_t *l ) { wchar_t ** res = malloc( sizeof(wchar_t *)*(al_get_count( l )+1) ); diff --git a/common.h b/common.h index 278554a41..c3ef109b2 100644 --- a/common.h +++ b/common.h @@ -8,6 +8,8 @@ */ #define FISH_COMMON_H +#include +#include #include #include diff --git a/event.c b/event.c index c9f2ff812..b4850e41a 100644 --- a/event.c +++ b/event.c @@ -388,7 +388,7 @@ static void event_fire_internal( event_t *event ) string_buffer_t *b=0; array_list_t *fire=0; - int was_subshell = is_subshell; + int was_interactive = is_interactive; /* First we free all events that have been removed @@ -464,7 +464,7 @@ static void event_fire_internal( event_t *event ) Event handlers are not part of the main flow of code, so they are marked as non-interactive and as a subshell */ - is_subshell=1; + is_interactive=0; parser_push_block( EVENT ); current_block->param1.event = event; eval( (wchar_t *)b->buff, 0, TOP ); @@ -475,7 +475,7 @@ static void event_fire_internal( event_t *event ) /* Restore interactivity flags */ - is_subshell = was_subshell; + is_interactive = was_interactive; if( b ) { @@ -628,6 +628,7 @@ void event_init() void event_destroy() { + if( events ) { al_foreach( events, (void (*)(const void *))&event_free ); @@ -635,6 +636,7 @@ void event_destroy() free( events ); events=0; } + if( killme ) { al_foreach( killme, (void (*)(const void *))&event_free ); @@ -642,6 +644,7 @@ void event_destroy() free( killme ); killme=0; } + if( get_desc_buff ) { sb_destroy( get_desc_buff ); diff --git a/wutil.h b/wutil.h index 81ee847b6..4230e6298 100644 --- a/wutil.h +++ b/wutil.h @@ -7,6 +7,8 @@ #ifndef FISH_WUTIL_H #define FISH_WUTIL_H +#include +#include #include #include #include