Output something reasonable for regular and expanded here-documents.
I would have chosen the EOF markers, but they are no longer available AFAICS, so output "<<HERE" and "<<XHERE" instead. (NOTE: These changes only affect DEBUG output.)
This commit is contained in:
parent
97c4cd6d34
commit
5eb49ee7ff
@ -144,6 +144,8 @@ shcmd(union node *cmd, FILE *fp)
|
|||||||
case NFROM: s = "<"; dftfd = 0; break;
|
case NFROM: s = "<"; dftfd = 0; break;
|
||||||
case NFROMTO: s = "<>"; dftfd = 0; break;
|
case NFROMTO: s = "<>"; dftfd = 0; break;
|
||||||
case NFROMFD: s = "<&"; dftfd = 0; break;
|
case NFROMFD: s = "<&"; dftfd = 0; break;
|
||||||
|
case NHERE: s = "<<"; dftfd = 0; break;
|
||||||
|
case NXHERE: s = "<<"; dftfd = 0; break;
|
||||||
default: s = "*error*"; dftfd = 0; break;
|
default: s = "*error*"; dftfd = 0; break;
|
||||||
}
|
}
|
||||||
if (np->nfile.fd != dftfd)
|
if (np->nfile.fd != dftfd)
|
||||||
@ -154,6 +156,10 @@ shcmd(union node *cmd, FILE *fp)
|
|||||||
fprintf(fp, "%d", np->ndup.dupfd);
|
fprintf(fp, "%d", np->ndup.dupfd);
|
||||||
else
|
else
|
||||||
fprintf(fp, "-");
|
fprintf(fp, "-");
|
||||||
|
} else if (np->nfile.type == NHERE) {
|
||||||
|
fprintf(fp, "HERE");
|
||||||
|
} else if (np->nfile.type == NXHERE) {
|
||||||
|
fprintf(fp, "XHERE");
|
||||||
} else {
|
} else {
|
||||||
sharg(np->nfile.fname, fp);
|
sharg(np->nfile.fname, fp);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user