mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-29 18:51:15 -03:00
Make execution of functions use wcsdup to make sure no memory errors happen if a function removes itself
darcs-hash:20060206134701-ac50b-27be7fe76512d6ac4313eea79b45a9c11083bccd.gz
This commit is contained in:
4
exec.c
4
exec.c
@@ -791,7 +791,7 @@ void exec( job_t *j )
|
||||
int i;
|
||||
string_buffer_t sb;
|
||||
|
||||
const wchar_t * def = function_get_definition( p->argv[0] );
|
||||
const wchar_t * def = wcsdup(function_get_definition( p->argv[0] ));
|
||||
//fwprintf( stderr, L"run function %ls\n", argv[0] );
|
||||
if( def == 0 )
|
||||
{
|
||||
@@ -834,6 +834,8 @@ void exec( job_t *j )
|
||||
|
||||
internal_exec_helper( def, TOP, j->io );
|
||||
|
||||
free( def );
|
||||
|
||||
parser_allow_function();
|
||||
parser_pop_block();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user