Add empty default cases where they should be, remove non-local execution stuff

in compat.c which doesn't even have preprocessor-conditional-hidden support
code, and add a debugging statement where we might end up with a nil list
somehow, but where I doubt it.

First confirmed userland kill for Flexelint.

Sponsored by:	Bright Path Solutions
This commit is contained in:
Juli Mallett 2002-09-28 20:03:26 +00:00
parent 079a527a3d
commit 1e3d8881cf
9 changed files with 36 additions and 14 deletions

View File

@ -193,8 +193,6 @@ CompatRunCommand (cmdp, gnp)
char **av; /* Argument vector for thing to exec */
int argc; /* Number of arguments in av or 0 if not
* dynamically allocated */
Boolean local; /* TRUE if command should be executed
* locally */
int internal; /* Various values.. */
char *cmd = (char *) cmdp;
GNode *gn = (GNode *) gnp;
@ -317,8 +315,6 @@ CompatRunCommand (cmdp, gnp)
av += 1;
}
local = TRUE;
/*
* Fork and execute the single command. If the fork fails, we abort.
*/
@ -327,15 +323,11 @@ CompatRunCommand (cmdp, gnp)
Fatal("Could not fork");
}
if (cpid == 0) {
if (local) {
execvp(av[0], av);
(void) write (STDERR_FILENO, av[0], strlen (av[0]));
(void) write (STDERR_FILENO, ":", 1);
(void) write (STDERR_FILENO, strerror(errno), strlen(strerror(errno)));
(void) write (STDERR_FILENO, "\n", 1);
} else {
(void)execv(av[0], av);
}
execvp(av[0], av);
(void) write (STDERR_FILENO, av[0], strlen (av[0]));
(void) write (STDERR_FILENO, ":", 1);
(void) write (STDERR_FILENO, strerror(errno), strlen(strerror(errno)));
(void) write (STDERR_FILENO, "\n", 1);
exit(1);
}

View File

@ -751,6 +751,8 @@ do_string_compare:
t = (left > right ? True : False);
}
break;
default:
break;
}
}
error:

View File

@ -473,6 +473,8 @@ DirExpandCurly(word, brace, path, expansions)
Dir_Expand(file, path, expansions);
goto next;
}
default:
break;
}
if (*cp2 == '\0') {
/*

View File

@ -921,6 +921,8 @@ JobFinish(job, status)
*/
done = FALSE;
break;
default:
break;
}
} else {
done = TRUE;

View File

@ -2088,7 +2088,8 @@ ParseSkipLine(skip)
Buf_ReplaceLastByte(buf, (Byte)' ');
lineno++;
while ((c = ParseReadc()) == ' ' || c == '\t');
while ((c = ParseReadc()) == ' ' || c == '\t')
continue;
if (c == EOF)
break;
@ -2288,6 +2289,8 @@ test_char:
semiNL = TRUE;
}
break;
default:
break;
}
/*
* Copy in the previous character and save this one in lastc.
@ -2365,6 +2368,8 @@ test_char:
line = ParseReadLine();
}
break;
default:
break;
}
}
return (line);

View File

@ -241,8 +241,12 @@ brk_string(str, store_argc, expand)
case 't':
ch = '\t';
break;
default:
break;
}
break;
default:
break;
}
if (!start)
start = t;

View File

@ -412,6 +412,9 @@ SuffInsert (l, s)
break;
}
}
if (s2 == NULL) {
DEBUGF(SUFF, ("inserting an empty list?..."));
}
Lst_Close (l);
DEBUGF(SUFF, ("inserting %s(%d)...", s->name, s->sNum));
@ -2357,6 +2360,8 @@ SuffPrintSuff (sp, dummy)
case SUFF_LIBRARY:
printf ("LIBRARY");
break;
default:
break;
}
fputc(flags ? '|' : ')', stdout);
}

View File

@ -577,6 +577,8 @@ TargPrintNode (gnp, passp)
printf("! "); break;
case OP_DOUBLEDEP:
printf(":: "); break;
default:
break;
}
Targ_PrintType (gn->type);
Lst_ForEach (gn->children, TargPrintName, (void *)0);

View File

@ -1538,6 +1538,8 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr)
return("$(.PREFIX)");
case '!':
return("$(.MEMBER)");
default:
break;
}
}
/*
@ -1644,6 +1646,8 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr)
return(val);
}
break;
default:
break;
}
}
}
@ -1670,6 +1674,8 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr)
case '!':
dynamic = TRUE;
break;
default:
break;
}
} else if ((vlen > 2) && (str[0] == '.') &&
isupper((unsigned char) str[1]) &&
@ -2077,6 +2083,8 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr)
case '1':
pattern.flags |= VAR_SUB_ONE;
continue;
default:
break;
}
break;
}