mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-12 11:10:07 +00:00
Tweak to make troff compile silently.
This commit is contained in:
parent
e98091cf8d
commit
1f72bc47fe
8 changed files with 13 additions and 17 deletions
|
@ -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;
|
||||
|
|
|
@ -10,6 +10,7 @@ int lseek(int, long, int);
|
|||
int close(int);
|
||||
int getpid(void);
|
||||
#endif
|
||||
char *unsharp(char*);
|
||||
|
||||
/*
|
||||
* c1.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];
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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 */
|
||||
|
|
Loading…
Reference in a new issue