style fixes. No code changes

This commit is contained in:
Denis Vlasenko
2007-04-12 00:32:05 +00:00
parent 50f7f446ec
commit 51742f4bb0
30 changed files with 84 additions and 82 deletions

View File

@ -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);
}

View File

@ -92,21 +92,21 @@ extern char **environ;
#ifdef MSHDEBUG
int mshdbg = MSHDEBUG;
#define DBGPRINTF(x) if(mshdbg>0)printf x
#define DBGPRINTF0(x) if(mshdbg>0)printf x
#define DBGPRINTF1(x) if(mshdbg>1)printf x
#define DBGPRINTF2(x) if(mshdbg>2)printf x
#define DBGPRINTF3(x) if(mshdbg>3)printf x
#define DBGPRINTF4(x) if(mshdbg>4)printf x
#define DBGPRINTF5(x) if(mshdbg>5)printf x
#define DBGPRINTF6(x) if(mshdbg>6)printf x
#define DBGPRINTF7(x) if(mshdbg>7)printf x
#define DBGPRINTF8(x) if(mshdbg>8)printf x
#define DBGPRINTF9(x) if(mshdbg>9)printf x
#define DBGPRINTF(x) if (mshdbg>0) printf x
#define DBGPRINTF0(x) if (mshdbg>0) printf x
#define DBGPRINTF1(x) if (mshdbg>1) printf x
#define DBGPRINTF2(x) if (mshdbg>2) printf x
#define DBGPRINTF3(x) if (mshdbg>3) printf x
#define DBGPRINTF4(x) if (mshdbg>4) printf x
#define DBGPRINTF5(x) if (mshdbg>5) printf x
#define DBGPRINTF6(x) if (mshdbg>6) printf x
#define DBGPRINTF7(x) if (mshdbg>7) printf x
#define DBGPRINTF8(x) if (mshdbg>8) printf x
#define DBGPRINTF9(x) if (mshdbg>9) printf x
int mshdbg_rc = 0;
#define RCPRINTF(x) if(mshdbg_rc)printf x
#define RCPRINTF(x) if (mshdbg_rc) printf x
#else