Make sure interactive mode is of when firing events

darcs-hash:20060206134532-ac50b-93f8a7cf7be2a82a1222fb520541b08bef33baa4.gz
This commit is contained in:
axel 2006-02-06 23:45:32 +10:00
parent c743ebf211
commit 0f76f77173
4 changed files with 10 additions and 5 deletions

View file

@ -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) );

View file

@ -8,6 +8,8 @@
*/
#define FISH_COMMON_H
#include <stdlib.h>
#include <stdio.h>
#include <wchar.h>
#include <termios.h>

View file

@ -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 );

View file

@ -7,6 +7,8 @@
#ifndef FISH_WUTIL_H
#define FISH_WUTIL_H
#include <stdlib.h>
#include <stdio.h>
#include <wchar.h>
#include <dirent.h>
#include <unistd.h>