Removed some more halloc

This commit is contained in:
ridiculousfish 2012-02-09 02:01:49 -08:00
parent 19cfd9b5d6
commit e5bba2294d
3 changed files with 7 additions and 6 deletions

View File

@ -1772,8 +1772,9 @@ static int builtin_function( parser_t &parser, wchar_t **argv )
{
function_data_t *d = new function_data_t();
d->name=halloc_wcsdup( parser.current_block, name);
d->description=desc?halloc_wcsdup( parser.current_block, desc):0;
d->name = name;
if (desc)
d->description = desc;
d->events.swap(events);
d->shadows = shadows;
if (named_arguments.get())

View File

@ -160,7 +160,7 @@ void function_init()
void function_add( function_data_t *data, const parser_t &parser )
{
CHECK( data->name, );
CHECK( ! data->name.empty(), );
CHECK( data->definition, );
scoped_lock lock(functions_lock);
function_remove( data->name );
@ -177,7 +177,7 @@ void function_add( function_data_t *data, const parser_t &parser )
info->named_arguments.insert(info->named_arguments.end(), data->named_arguments.begin(), data->named_arguments.end());
}
if (data->description)
if (! data->description.empty())
info->description = data->description;
info->definition_file = intern(reader_current_filename());
info->is_autoload = is_autoload;

View File

@ -34,11 +34,11 @@ struct function_data_t
/**
Name of function
*/
wchar_t *name;
wcstring name;
/**
Description of function
*/
wchar_t *description;
wcstring description;
/**
Function definition
*/