fix troff input (Colin DeVilbiss)

This commit is contained in:
rsc 2007-05-05 13:08:06 +00:00
parent cd2bb6ce1d
commit e17c64a7cd

View file

@ -13,6 +13,7 @@ initfilt(Biobuf *b, int argc, char **argv, uchar *buf, int nbuf, char *type, cha
int p[2]; int p[2];
char xbuf[8192]; char xbuf[8192];
int n; int n;
char template[] = "/tmp/pagecvtXXXXXXXXX";
if(argc > 1) { if(argc > 1) {
fprint(2, "can only view one %s file at a time\n", type); fprint(2, "can only view one %s file at a time\n", type);
@ -31,7 +32,7 @@ initfilt(Biobuf *b, int argc, char **argv, uchar *buf, int nbuf, char *type, cha
p[1] = open("/dev/null", ORDWR); p[1] = open("/dev/null", ORDWR);
} }
ofd = opentemp("/tmp/pagecvtXXXXXXXXX"); ofd = opentemp(template);
switch(fork()){ switch(fork()){
case -1: case -1:
fprint(2, "fork fails: %r\n"); fprint(2, "fork fails: %r\n");
@ -100,7 +101,7 @@ initdvi(Biobuf *b, int argc, char **argv, uchar *buf, int nbuf)
Document* Document*
inittroff(Biobuf *b, int argc, char **argv, uchar *buf, int nbuf) inittroff(Biobuf *b, int argc, char **argv, uchar *buf, int nbuf)
{ {
return initfilt(b, argc, argv, buf, nbuf, "troff", "lp -dstdout", 1); return initfilt(b, argc, argv, buf, nbuf, "troff", "9 tr2post | 9 psfonts", 1);
} }
Document* Document*