mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-01 03:32:02 +08:00
Removed some more halloc
This commit is contained in:
parent
19cfd9b5d6
commit
e5bba2294d
|
@ -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())
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue
Block a user