mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-10 23:24:39 +00:00
Minor code tweaks, mostly things like indentation, but also a ferw code reorderings
darcs-hash:20060828120244-ac50b-ad4be149ff245b6f799452f9eeff7bcc60af1526.gz
This commit is contained in:
parent
9525f429c6
commit
53ea5d60b7
6 changed files with 21 additions and 23 deletions
22
builtin.c
22
builtin.c
|
@ -2778,7 +2778,7 @@ static int builtin_switch( wchar_t **argv )
|
|||
current_block->skip=1;
|
||||
current_block->param2.switch_taken=0;
|
||||
}
|
||||
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@ -2790,7 +2790,7 @@ static int builtin_case( wchar_t **argv )
|
|||
int argc = builtin_count_args( argv );
|
||||
int i;
|
||||
wchar_t *unescaped=0;
|
||||
|
||||
|
||||
if( current_block->type != SWITCH )
|
||||
{
|
||||
sb_printf( sb_err,
|
||||
|
@ -2799,30 +2799,30 @@ static int builtin_case( wchar_t **argv )
|
|||
builtin_print_help( argv[0], sb_err );
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
current_block->skip = 1;
|
||||
|
||||
|
||||
if( current_block->param2.switch_taken )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
for( i=1; i<argc; i++ )
|
||||
{
|
||||
free( unescaped );
|
||||
|
||||
int match;
|
||||
|
||||
unescaped = parse_util_unescape_wildcards( argv[i] );
|
||||
match = wildcard_match( current_block->param1.switch_value, unescaped );
|
||||
free( unescaped );
|
||||
|
||||
|
||||
if( wildcard_match( current_block->param1.switch_value, unescaped ) )
|
||||
if( match )
|
||||
{
|
||||
current_block->skip = 0;
|
||||
current_block->param2.switch_taken = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
free( unescaped );
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -650,7 +650,7 @@ static int builtin_set( wchar_t **argv )
|
|||
builtin_print_help( argv[0], sb_err );
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
if( (bad_char = wcsvarname( dest ) ) )
|
||||
{
|
||||
sb_printf( sb_err, BUILTIN_ERR_VARCHAR, argv[0], *bad_char );
|
||||
|
@ -659,7 +659,6 @@ static int builtin_set( wchar_t **argv )
|
|||
return 1;
|
||||
}
|
||||
|
||||
|
||||
if( slice && erase && (scope != ENV_USER) )
|
||||
{
|
||||
free( dest );
|
||||
|
@ -687,7 +686,7 @@ static int builtin_set( wchar_t **argv )
|
|||
al_init(&values);
|
||||
al_init(&indexes);
|
||||
al_init(&result);
|
||||
|
||||
|
||||
tokenize_variable_array( env_get(dest), &result );
|
||||
|
||||
for( ; woptind<argc; woptind++ )
|
||||
|
|
1
env.h
1
env.h
|
@ -129,7 +129,6 @@ char **env_export_arr( int recalc );
|
|||
|
||||
/**
|
||||
Insert all variable names into l. These are not copies of the strings and should not be freed after use.
|
||||
|
||||
*/
|
||||
void env_get_names( array_list_t *l, int flags );
|
||||
|
||||
|
|
10
fallback.c
10
fallback.c
|
@ -1079,11 +1079,11 @@ int killpg( int pgr, int sig )
|
|||
|
||||
#ifndef HAVE_WORKING_GETOPT_LONG
|
||||
|
||||
int getopt_long(int argc,
|
||||
char * const argv[],
|
||||
const char *optstring,
|
||||
const struct option *longopts,
|
||||
int *longindex)
|
||||
int getopt_long( int argc,
|
||||
char * const argv[],
|
||||
const char *optstring,
|
||||
const struct option *longopts,
|
||||
int *longindex )
|
||||
{
|
||||
return getopt( argc, argv, optstring );
|
||||
}
|
||||
|
|
|
@ -931,7 +931,7 @@ static void init()
|
|||
output_set_writer( &pager_buffered_writer );
|
||||
pager_buffer = halloc( global_context, sizeof( buffer_t ) );
|
||||
halloc_register_function( global_context, (void (*)(void *))&b_destroy, pager_buffer );
|
||||
|
||||
|
||||
sigemptyset( & act.sa_mask );
|
||||
act.sa_flags=0;
|
||||
act.sa_handler=SIG_DFL;
|
||||
|
@ -944,7 +944,7 @@ static void init()
|
|||
}
|
||||
|
||||
handle_winch( 0 ); /* Set handler for window change events */
|
||||
|
||||
|
||||
tcgetattr(0,&pager_modes); /* get the current terminal modes */
|
||||
memcpy( &saved_modes,
|
||||
&pager_modes,
|
||||
|
|
2
proc.c
2
proc.c
|
@ -454,7 +454,7 @@ void job_handle_signal ( int signal, siginfo_t *info, void *con )
|
|||
handle_child_status( pid, status );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
kill( 0, SIGIO );
|
||||
errno=errno_old;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue