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:
schweikh 2006-04-14 13:59:03 +00:00
parent 97c4cd6d34
commit 5eb49ee7ff

View File

@ -144,6 +144,8 @@ shcmd(union node *cmd, FILE *fp)
case NFROM: s = "<"; dftfd = 0; break;
case NFROMTO: 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;
}
if (np->nfile.fd != dftfd)
@ -154,6 +156,10 @@ shcmd(union node *cmd, FILE *fp)
fprintf(fp, "%d", np->ndup.dupfd);
else
fprintf(fp, "-");
} else if (np->nfile.type == NHERE) {
fprintf(fp, "HERE");
} else if (np->nfile.type == NXHERE) {
fprintf(fp, "XHERE");
} else {
sharg(np->nfile.fname, fp);
}