tfix troff input (Colin DeVilbiss) - plan9port - [fork] Plan 9 from user space
(HTM) git clone git://src.adamsgaard.dk/plan9port
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit e17c64a7cd5162ee586f4b1bdd797f64381859d9
(DIR) parent cd2bb6ce1de4f0769f4c2e570d8eeb49bfa320cc
(HTM) Author: rsc <devnull@localhost>
Date: Sat, 5 May 2007 13:08:06 +0000
fix troff input (Colin DeVilbiss)
Diffstat:
M src/cmd/page/filter.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
---
(DIR) diff --git a/src/cmd/page/filter.c b/src/cmd/page/filter.c
t@@ -13,6 +13,7 @@ initfilt(Biobuf *b, int argc, char **argv, uchar *buf, int nbuf, char *type, cha
int p[2];
char xbuf[8192];
int n;
+ char template[] = "/tmp/pagecvtXXXXXXXXX";
if(argc > 1) {
fprint(2, "can only view one %s file at a time\n", type);
t@@ -31,7 +32,7 @@ initfilt(Biobuf *b, int argc, char **argv, uchar *buf, int nbuf, char *type, cha
p[1] = open("/dev/null", ORDWR);
}
- ofd = opentemp("/tmp/pagecvtXXXXXXXXX");
+ ofd = opentemp(template);
switch(fork()){
case -1:
fprint(2, "fork fails: %r\n");
t@@ -100,7 +101,7 @@ initdvi(Biobuf *b, int argc, char **argv, uchar *buf, int nbuf)
Document*
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*