first = 1;
for (np = cmd->ncmd.args; np; np = np->narg.next) {
- if (! first)
- putchar(' ');
+ if (!first)
+ putc(' ', fp);
sharg(np, fp);
first = 0;
}
for (np = cmd->ncmd.redirect; np; np = np->nfile.next) {
- if (! first)
- putchar(' ');
+ if (!first)
+ putc(' ', fp);
+ dftfd = 0;
switch (np->nfile.type) {
- case NTO: s = ">"; dftfd = 1; break;
- case NCLOBBER: s = ">|"; dftfd = 1; break;
- case NAPPEND: s = ">>"; dftfd = 1; break;
- case NTOFD: s = ">&"; dftfd = 1; break;
- case NFROM: s = "<"; dftfd = 0; break;
- case NFROMFD: s = "<&"; dftfd = 0; break;
- case NFROMTO: s = "<>"; dftfd = 0; break;
- default: s = "*error*"; dftfd = 0; break;
+ case NTO: s = ">>"+1; dftfd = 1; break;
+ case NCLOBBER: s = ">|"; dftfd = 1; break;
+ case NAPPEND: s = ">>"; dftfd = 1; break;
+ case NTOFD: s = ">&"; dftfd = 1; break;
+ case NFROM: s = "<"; break;
+ case NFROMFD: s = "<&"; break;
+ case NFROMTO: s = "<>"; break;
+ default: s = "*error*"; break;
}
if (np->nfile.fd != dftfd)
fprintf(fp, "%d", np->nfile.fd);
struct procstat *ps;
struct procstat *psend;
int col;
- int indent;
+ int indent_col;
char s[80];
ps = jp->ps;
}
col = fmtstr(s, 16, "[%d] ", jobno(jp));
- indent = col;
+ indent_col = col;
if (jp == curjob)
s[col - 2] = '+';
do {
/* for each process */
- col = fmtstr(s, 48, " |\n%*c%d ", indent, ' ', ps->pid) - 3;
+ col = fmtstr(s, 48, " |\n%*c%d ", indent_col, ' ', ps->pid) - 3;
start:
fprintf(out, "%s%*c%s",
s, 33 - col >= 0 ? 33 - col : 0, ' ', ps->cmd