summaryrefslogtreecommitdiff
path: root/shell/bbsh.c
diff options
context:
space:
mode:
Diffstat (limited to 'shell/bbsh.c')
-rw-r--r--shell/bbsh.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/shell/bbsh.c b/shell/bbsh.c
index 6bef368..8f0fb05 100644
--- a/shell/bbsh.c
+++ b/shell/bbsh.c
@@ -68,7 +68,7 @@ struct pipeline {
static void free_list(void *list, void (*freeit)(void *data))
{
- while(list) {
+ while (list) {
void **next = (void **)list;
void *list_next = *next;
freeit(list);
@@ -159,12 +159,12 @@ static int run_pipeline(struct pipeline *line)
// Handle local commands. This is totally fake and plastic.
if (cmd->argc==2 && !strcmp(cmd->argv[0],"cd"))
chdir(cmd->argv[1]);
- else if(!strcmp(cmd->argv[0],"exit"))
+ else if (!strcmp(cmd->argv[0],"exit"))
exit(cmd->argc>1 ? atoi(cmd->argv[1]) : 0);
else {
int status;
pid_t pid=fork();
- if(!pid) {
+ if (!pid) {
run_applet_and_exit(cmd->argv[0],cmd->argc,cmd->argv);
execvp(cmd->argv[0],cmd->argv);
printf("No %s",cmd->argv[0]);
@@ -179,7 +179,7 @@ static void free_cmd(void *data)
{
struct command *cmd=(struct command *)data;
- while(cmd->argc) free(cmd->argv[--cmd->argc]);
+ while (cmd->argc) free(cmd->argv[--cmd->argc]);
}
@@ -211,8 +211,8 @@ int bbsh_main(int argc, char **argv)
else {
unsigned cmdlen=0;
for (;;) {
- if(!f) putchar('$');
- if(1 > getline(&command, &cmdlen,f ? : stdin)) break;
+ if (!f) putchar('$');
+ if (1 > getline(&command, &cmdlen,f ? : stdin)) break;
handle(command);
}