mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-08 10:51:15 -03:00
Validate variables names when using named arguments for functions
darcs-hash:20070422211624-ac50b-11920a8a00c7bae97c3556bc7ce47b3022c34f08.gz
This commit is contained in:
10
builtin.c
10
builtin.c
@@ -1364,6 +1364,16 @@ static int builtin_function( wchar_t **argv )
|
||||
{
|
||||
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++] ) );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user