mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-28 13:53:10 +00:00
Validate variables names when using named arguments for functions
darcs-hash:20070422211624-ac50b-11920a8a00c7bae97c3556bc7ce47b3022c34f08.gz
This commit is contained in:
parent
7ca76ef743
commit
c5805cfd47
1 changed files with 10 additions and 0 deletions
10
builtin.c
10
builtin.c
|
@ -1364,6 +1364,16 @@ static int builtin_function( wchar_t **argv )
|
||||||
{
|
{
|
||||||
while( woptind < argc )
|
while( woptind < argc )
|
||||||
{
|
{
|
||||||
|
if( wcsvarname( argv[woptind] ) )
|
||||||
|
{
|
||||||
|
sb_printf( sb_err,
|
||||||
|
_( L"%ls: Invalid variable name '%ls'\n" ),
|
||||||
|
argv[0],
|
||||||
|
argv[woptind] );
|
||||||
|
res = STATUS_BUILTIN_ERROR;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
al_push( named_arguments, halloc_wcsdup( current_block, argv[woptind++] ) );
|
al_push( named_arguments, halloc_wcsdup( current_block, argv[woptind++] ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue