mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-06 00:41:15 -03:00
Make sure functions as printed by the fyunctions builtin don't have any stray empty lines
darcs-hash:20060114015801-ac50b-135fb66cf74a9cd51f6d52e2eff12c55042e4183.gz
This commit is contained in:
@@ -720,6 +720,7 @@ static void functions_def( wchar_t *name )
|
||||
def,
|
||||
L"\nend\n\n",
|
||||
(void *)0);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -2339,7 +2340,7 @@ static int builtin_fg( wchar_t **argv )
|
||||
int pid = abs(wcstol( argv[1], 0, 10 ));
|
||||
j = job_get_from_pid( pid );
|
||||
sb_printf( sb_err,
|
||||
_( "%ls: No suitable job: %d\n" ),
|
||||
_( L"%ls: No suitable job: %d\n" ),
|
||||
argv[0],
|
||||
pid );
|
||||
builtin_print_help( argv[0], sb_err );
|
||||
@@ -3332,7 +3333,6 @@ void builtin_get_names( array_list_t *list )
|
||||
|
||||
const wchar_t *builtin_get_desc( const wchar_t *b )
|
||||
{
|
||||
wchar_t *res;
|
||||
|
||||
if( !desc )
|
||||
{
|
||||
|
||||
@@ -68,12 +68,20 @@ void function_add( const wchar_t *name,
|
||||
int is_binding )
|
||||
{
|
||||
int i;
|
||||
wchar_t *cmd_end;
|
||||
|
||||
|
||||
if( function_exists( name ) )
|
||||
function_remove( name );
|
||||
|
||||
function_data_t *d = malloc( sizeof( function_data_t ) );
|
||||
d->cmd = wcsdup( val );
|
||||
cmd_end = d->cmd + wcslen(d->cmd)-1;
|
||||
while( (cmd_end>d->cmd) && wcschr( L"\n\r\t ", *cmd_end ) )
|
||||
{
|
||||
*cmd_end--=0;
|
||||
}
|
||||
|
||||
d->desc = desc?wcsdup( desc ):0;
|
||||
d->is_binding = is_binding;
|
||||
hash_put( &function, intern(name), d );
|
||||
|
||||
Reference in New Issue
Block a user