aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/troff
diff options
context:
space:
mode:
authorwkj <devnull@localhost>2004-05-17 02:23:11 +0000
committerwkj <devnull@localhost>2004-05-17 02:23:11 +0000
commit1f72bc47fe416f8fa00d8cea27ee1482fba28c20 (patch)
treede3d265ad04b75af97bb591189534232c2ac9b81 /src/cmd/troff
parente98091cf8d836fca982a5baac166e138edd670b1 (diff)
downloadplan9port-1f72bc47fe416f8fa00d8cea27ee1482fba28c20.tar.gz
plan9port-1f72bc47fe416f8fa00d8cea27ee1482fba28c20.tar.bz2
plan9port-1f72bc47fe416f8fa00d8cea27ee1482fba28c20.zip
Tweak to make troff compile silently.
Diffstat (limited to 'src/cmd/troff')
-rw-r--r--src/cmd/troff/ext.h1
-rw-r--r--src/cmd/troff/fns.h1
-rw-r--r--src/cmd/troff/mbwc.c2
-rw-r--r--src/cmd/troff/n1.c6
-rw-r--r--src/cmd/troff/n10.c2
-rw-r--r--src/cmd/troff/n5.c2
-rw-r--r--src/cmd/troff/n8.c10
-rw-r--r--src/cmd/troff/t11.c6
8 files changed, 13 insertions, 17 deletions
diff --git a/src/cmd/troff/ext.h b/src/cmd/troff/ext.h
index 5e187563..8df12f2c 100644
--- a/src/cmd/troff/ext.h
+++ b/src/cmd/troff/ext.h
@@ -99,6 +99,7 @@ extern int pnlist[];
extern int po1;
extern int po;
extern int ppts;
+#define print troffprint
extern int print;
extern FILE *ptid;
extern int pto;
diff --git a/src/cmd/troff/fns.h b/src/cmd/troff/fns.h
index 087d4c80..922a3a80 100644
--- a/src/cmd/troff/fns.h
+++ b/src/cmd/troff/fns.h
@@ -10,6 +10,7 @@ int lseek(int, long, int);
int close(int);
int getpid(void);
#endif
+char *unsharp(char*);
/*
* c1.c
diff --git a/src/cmd/troff/mbwc.c b/src/cmd/troff/mbwc.c
index 8bc2e944..e5234896 100644
--- a/src/cmd/troff/mbwc.c
+++ b/src/cmd/troff/mbwc.c
@@ -130,7 +130,7 @@ mbstowcs(wchar_t *pwcs, const char *s, size_t n)
size_t
wcstombs(char *s, const wchar_t *pwcs, size_t n)
{
- int /*i,*/ d;
+ int d;
long c;
char *p, *pe;
char buf[3];
diff --git a/src/cmd/troff/n1.c b/src/cmd/troff/n1.c
index 45e99f3f..7fe87b63 100644
--- a/src/cmd/troff/n1.c
+++ b/src/cmd/troff/n1.c
@@ -828,7 +828,7 @@ n1:
if (p[0] == '-' && p[1] == 0) {
ifile = stdin;
strcpy(cfname[ifi], "stdin");
- } else if ((ifile = fopen(p, "r")) == NULL) {
+ } else if ((ifile = fopen(unsharp(p), "r")) == NULL) {
ERROR "cannot open file %s", p WARN;
nfo -= mflg;
done(02);
@@ -936,7 +936,7 @@ void caseso(void)
lgf++;
nextf[0] = 0;
- if (skip() || !getname() || (fp = fopen(nextf, "r")) == NULL || ifi >= NSO) {
+ if (skip() || !getname() || (fp = fopen(unsharp(nextf), "r")) == NULL || ifi >= NSO) {
ERROR "can't open file %s", nextf WARN;
done(02);
}
@@ -1005,7 +1005,7 @@ void casecf(void)
nextf[0] = 0;
if (!skip() && getname()) {
if (strncmp("<<", nextf, 2) != 0) {
- if ((fd = fopen(nextf, "r")) == NULL) {
+ if ((fd = fopen(unsharp(nextf), "r")) == NULL) {
ERROR "can't open file %s", nextf WARN;
done(02);
}
diff --git a/src/cmd/troff/n10.c b/src/cmd/troff/n10.c
index de2461d8..91579480 100644
--- a/src/cmd/troff/n10.c
+++ b/src/cmd/troff/n10.c
@@ -185,7 +185,7 @@ void n_ptinit(void)
/* hyphalg = 0; /* for testing */
strcat(termtab, devname);
- if ((fp = fopen(termtab, "r")) == NULL) {
+ if ((fp = fopen(unsharp(termtab), "r")) == NULL) {
ERROR "cannot open %s", termtab WARN;
exit(-1);
}
diff --git a/src/cmd/troff/n5.c b/src/cmd/troff/n5.c
index ab5ef2e5..2c7d3287 100644
--- a/src/cmd/troff/n5.c
+++ b/src/cmd/troff/n5.c
@@ -409,7 +409,7 @@ void casefm(void)
return;
}
if (fcache[i].fp == NULL) {
- if( (fcache[i].fp = fopen(nextf, "w")) == NULL) {
+ if( (fcache[i].fp = fopen(unsharp(nextf), "w")) == NULL) {
ERROR "fm: cannot open %s", nextf WARN;
return;
}
diff --git a/src/cmd/troff/n8.c b/src/cmd/troff/n8.c
index bace4aae..ded45438 100644
--- a/src/cmd/troff/n8.c
+++ b/src/cmd/troff/n8.c
@@ -461,19 +461,13 @@ static int texit(Tchar *start, Tchar *end) /* hyphenate as in tex, return # foun
characters. sigh.
*/
-extern char *unsharp(char*);
-
-static char *texhyphens;
-
static int readpats(void)
{
FILE *fp;
char buf[200], buf1[200];
- if(texhyphens == 0)
- texhyphens = unsharp(TEXHYPHENS);
- if ((fp = fopen(texhyphens, "r")) == NULL
- && (fp = fopen(DWBalthyphens, "r")) == NULL) {
+ if ((fp = fopen(unsharp(TEXHYPHENS), "r")) == NULL
+ && (fp = fopen(unsharp(DWBalthyphens), "r")) == NULL) {
ERROR "warning: can't find hyphen.tex" WARN;
return 0;
}
diff --git a/src/cmd/troff/t11.c b/src/cmd/troff/t11.c
index 398d74da..f930d8b1 100644
--- a/src/cmd/troff/t11.c
+++ b/src/cmd/troff/t11.c
@@ -24,7 +24,7 @@ getdesc(char *name)
char cmd[100], s[100];
int i, v;
- if ((fin = fopen(name, "r")) == NULL)
+ if ((fin = fopen(unsharp(name), "r")) == NULL)
return -1;
while (fscanf(fin, "%s", cmd) != EOF) {
if (strcmp(cmd, "res") == 0) {
@@ -65,7 +65,7 @@ static int checkfont(char *name)
char buf[300], buf2[300];
int i, status = -1;
- if ((fp = fopen(name, "r")) == NULL)
+ if ((fp = fopen(unsharp(name), "r")) == NULL)
return -1;
for (i = 1; i <= 10; i++) {
if (fgets(buf, sizeof buf, fp) == NULL)
@@ -100,7 +100,7 @@ getfont(char *name, int pos) /* create width tab for font */
/* fprintf(stderr, "read font %s onto %d\n", name, pos); */
if (checkfont(name) == -1)
return -1;
- if ((fin = fopen(name, "r")) == NULL)
+ if ((fin = fopen(unsharp(name), "r")) == NULL)
return -1;
for (i = 0; i < ALPHABET; i++)
chtemp[i] = chinit; /* zero out to begin with */