Tweak to make troff compile silently.
diff --git a/src/cmd/troff/ext.h b/src/cmd/troff/ext.h index 5e18756..8df12f2 100644 --- a/src/cmd/troff/ext.h +++ b/src/cmd/troff/ext.h
@@ -99,6 +99,7 @@ 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 087d4c8..922a3a8 100644 --- a/src/cmd/troff/fns.h +++ b/src/cmd/troff/fns.h
@@ -10,6 +10,7 @@ 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 8bc2e94..e523489 100644 --- a/src/cmd/troff/mbwc.c +++ b/src/cmd/troff/mbwc.c
@@ -130,7 +130,7 @@ 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 45e99f3..7fe87b6 100644 --- a/src/cmd/troff/n1.c +++ b/src/cmd/troff/n1.c
@@ -828,7 +828,7 @@ 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 @@ 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 @@ 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 de2461d..9157948 100644 --- a/src/cmd/troff/n10.c +++ b/src/cmd/troff/n10.c
@@ -185,7 +185,7 @@ /* 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 ab5ef2e..2c7d328 100644 --- a/src/cmd/troff/n5.c +++ b/src/cmd/troff/n5.c
@@ -409,7 +409,7 @@ 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 bace4aa..ded4543 100644 --- a/src/cmd/troff/n8.c +++ b/src/cmd/troff/n8.c
@@ -461,19 +461,13 @@ 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 398d74d..f930d8b 100644 --- a/src/cmd/troff/t11.c +++ b/src/cmd/troff/t11.c
@@ -24,7 +24,7 @@ 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 @@ 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 @@ /* 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 */