aboutsummaryrefslogtreecommitdiffhomepage
path: root/builtin.c
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2006-06-09 09:57:19 +1000
committerGravatar axel <axel@liljencrantz.se>2006-06-09 09:57:19 +1000
commitaf8cb6fe875898d9a8c2254361bed04583c35961 (patch)
treef4a95a5acb242b5e3e3fcc110d9ce243d9f43b5a /builtin.c
parent5855f78010b4f0a06ca0fdf98b78a203e45f7514 (diff)
Minor code edits - add a few braces, a few minor safety checks, etc.
darcs-hash:20060608235719-ac50b-bec405da5ae101ff50bb3390bb83ef8b0948e4e9.gz
Diffstat (limited to 'builtin.c')
-rw-r--r--builtin.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/builtin.c b/builtin.c
index fde2b5ac..b57068c2 100644
--- a/builtin.c
+++ b/builtin.c
@@ -1902,7 +1902,10 @@ static int builtin_exit( wchar_t **argv )
switch( argc )
{
case 1:
+ {
break;
+ }
+
case 2:
{
wchar_t *end;
@@ -1921,13 +1924,15 @@ static int builtin_exit( wchar_t **argv )
}
default:
+ {
sb_printf( sb_err,
BUILTIN_ERR_TOO_MANY_ARGUMENTS,
argv[0] );
builtin_print_help( argv[0], sb_err );
return 1;
-
+ }
+
}
reader_exit( 1, 0 );
return ec;
@@ -1983,10 +1988,12 @@ static int builtin_cd( wchar_t **argv )
argv[0],
dir_in );
if( !is_interactive )
+ {
sb_append2( sb_err,
parser_current_line(),
(void *)0 );
-
+ }
+
return 1;
}
@@ -1997,9 +2004,11 @@ static int builtin_cd( wchar_t **argv )
argv[0],
dir );
if( !is_interactive )
+ {
sb_append2( sb_err,
parser_current_line(),
(void *)0 );
+ }
free( dir );
@@ -2116,7 +2125,9 @@ static void make_first( job_t *j )
if( curr == j )
{
if( prev == 0 )
+ {
return;
+ }
else
{
prev->next = curr->next;
@@ -2144,7 +2155,9 @@ static int builtin_fg( wchar_t **argv )
{
if( j->constructed && (!job_is_completed(j)) &&
( (job_is_stopped(j) || !j->fg) && (j->job_control) ) )
+ {
break;
+ }
}
if( !j )
{
@@ -2307,9 +2320,11 @@ static int builtin_bg( wchar_t **argv )
for( j=first_job; j; j=j->next )
{
if( job_is_stopped(j) && j->job_control && (!job_is_completed(j)) )
+ {
break;
+ }
}
-
+
if( !j )
{
sb_printf( sb_err,