diff options
author | Petter Rodhelind <petter.rodhelind@gmail.com> | 2020-01-14 11:41:08 +0100 |
---|---|---|
committer | Petter Rodhelind <petter.rodhelind@gmail.com> | 2020-01-14 11:41:08 +0100 |
commit | 02d7aa8915f9c3a3288dab01f321eb94ba219e3b (patch) | |
tree | f053238978479e408a2b83571443e132f30586ab /src/cmd/troff | |
parent | c0c9d8f883dfd3a7f5a74499d91bb95884b15873 (diff) | |
parent | 3d1382b98a502d0c34d5ba2c462396acc515016e (diff) | |
download | plan9port-02d7aa8915f9c3a3288dab01f321eb94ba219e3b.tar.gz plan9port-02d7aa8915f9c3a3288dab01f321eb94ba219e3b.tar.bz2 plan9port-02d7aa8915f9c3a3288dab01f321eb94ba219e3b.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'src/cmd/troff')
-rw-r--r-- | src/cmd/troff/dwbinit.c | 5 | ||||
-rw-r--r-- | src/cmd/troff/ext.h | 1 | ||||
-rw-r--r-- | src/cmd/troff/mbwc.c | 1 | ||||
-rw-r--r-- | src/cmd/troff/n1.c | 10 | ||||
-rw-r--r-- | src/cmd/troff/n10.c | 20 | ||||
-rw-r--r-- | src/cmd/troff/n2.c | 12 | ||||
-rw-r--r-- | src/cmd/troff/n3.c | 20 | ||||
-rw-r--r-- | src/cmd/troff/n4.c | 4 | ||||
-rw-r--r-- | src/cmd/troff/n5.c | 48 | ||||
-rw-r--r-- | src/cmd/troff/n6.c | 6 | ||||
-rw-r--r-- | src/cmd/troff/n7.c | 28 | ||||
-rw-r--r-- | src/cmd/troff/n8.c | 16 | ||||
-rw-r--r-- | src/cmd/troff/n9.c | 18 | ||||
-rw-r--r-- | src/cmd/troff/ni.c | 1 | ||||
-rw-r--r-- | src/cmd/troff/t10.c | 10 | ||||
-rw-r--r-- | src/cmd/troff/t11.c | 4 | ||||
-rw-r--r-- | src/cmd/troff/t6.c | 34 | ||||
-rw-r--r-- | src/cmd/troff/tdef.h | 8 |
18 files changed, 121 insertions, 125 deletions
diff --git a/src/cmd/troff/dwbinit.c b/src/cmd/troff/dwbinit.c index 064a0b02..5ecad041 100644 --- a/src/cmd/troff/dwbinit.c +++ b/src/cmd/troff/dwbinit.c @@ -55,7 +55,7 @@ * NULL, xyzzy, sizeof(xyzzy), * NULL, NULL, 0 * }; - * + * * The last element must have NULL entries for the address and * value fields. The main() routine would then do, * @@ -300,7 +300,7 @@ void DWBprefix( char *prog, char *path, int length) * not great, but should be good enough for now. Also probably should * have DWBhome() only do the lookup once, and remember the value if * called again. - * + * */ if ( strncmp(path, DWBPREFIX, len) == 0 ) { @@ -315,4 +315,3 @@ void DWBprefix( char *prog, char *path, int length) } /* End of DWBprefix */ /*****************************************************************************/ - diff --git a/src/cmd/troff/ext.h b/src/cmd/troff/ext.h index 8df12f2c..4c2fcf9d 100644 --- a/src/cmd/troff/ext.h +++ b/src/cmd/troff/ext.h @@ -184,4 +184,3 @@ extern int c_isalnum; extern char *DWBfontdir; extern char *DWBntermdir; extern char *DWBalthyphens; - diff --git a/src/cmd/troff/mbwc.c b/src/cmd/troff/mbwc.c index c97b036c..39763508 100644 --- a/src/cmd/troff/mbwc.c +++ b/src/cmd/troff/mbwc.c @@ -162,4 +162,3 @@ wcstombs(char *s, const wchar_t *pwcs, size_t n) } return p-s; } - diff --git a/src/cmd/troff/n1.c b/src/cmd/troff/n1.c index c65898ce..adda8c4b 100644 --- a/src/cmd/troff/n1.c +++ b/src/cmd/troff/n1.c @@ -148,7 +148,7 @@ main(int argc, char *argv[]) save_tty(); break; case 'V': - fprintf(stdout, "%croff: DWB %s\n", + fprintf(stdout, "%croff: DWB %s\n", TROFF ? 't' : 'n', DWBVERSION); exit(0); case 't': @@ -436,12 +436,12 @@ g0: return(k); } if (k == FLSS) { - copyf++; + copyf++; raw++; i = getch0(); if (!fi) flss = i; - copyf--; + copyf--; raw--; goto g0; } @@ -456,8 +456,8 @@ g0: } if (k == fc || k == tabch || k == ldrch) { if ((i = setfield(k)) == 0) - goto g0; - else + goto g0; + else return(i); } if (k == '\b') { diff --git a/src/cmd/troff/n10.c b/src/cmd/troff/n10.c index b6be4c51..6f41dae2 100644 --- a/src/cmd/troff/n10.c +++ b/src/cmd/troff/n10.c @@ -319,7 +319,7 @@ void ptout1(void) j = -j; if (isvmot(i)) lead += j; - else + else esc += j; continue; } @@ -432,13 +432,13 @@ char *plot(char *x) } else if (*k & 0200) { if (*k & 0100) { if (*k & 040) - j = t.up; - else + j = t.up; + else j = t.down; } else { if (*k & 040) - j = t.left; - else + j = t.left; + else j = t.right; } if ((i = *k & 037) == 0) { /* 2nd 0200 turns it off */ @@ -447,7 +447,7 @@ char *plot(char *x) } while (i--) oputs(j); - } else + } else oput(*k); } oputs(t.plotoff); @@ -464,8 +464,8 @@ void move(void) iesct = esct; if (esct += esc) - i = "\0"; - else + i = "\0"; + else i = "\n\0"; j = t.hlf; p = t.right; @@ -492,10 +492,10 @@ void move(void) } else { /* no half-line forward, not at line begining */ k = lead / t.Newline; lead = lead % t.Newline; - if (k > 0) + if (k > 0) esc = esct; i = "\n"; - while (k--) + while (k--) oputs(i); } } diff --git a/src/cmd/troff/n2.c b/src/cmd/troff/n2.c index 2943e553..41b2ec1e 100644 --- a/src/cmd/troff/n2.c +++ b/src/cmd/troff/n2.c @@ -53,7 +53,7 @@ int pchar(Tchar i) return 0; } if (ismot(i)) { - pchar1(i); + pchar1(i); return 0; } switch (j = cbits(i)) { @@ -213,7 +213,7 @@ void caseex(void) } -void done(int x) +void done(int x) { int i; @@ -249,7 +249,7 @@ void done(int x) } -void done1(int x) +void done1(int x) { error |= x; if (numtabp[NL].val) { @@ -263,7 +263,7 @@ void done1(int x) } -void done2(int x) +void done2(int x) { ptlead(); if (TROFF && !ascii) @@ -272,7 +272,7 @@ void done2(int x) done3(x); } -void done3(int x) +void done3(int x) { error |= x; flusho(); @@ -284,7 +284,7 @@ void done3(int x) } -void edone(int x) +void edone(int x) { frame = stk; nxf = frame + 1; diff --git a/src/cmd/troff/n3.c b/src/cmd/troff/n3.c index 8279d748..1c7c574f 100644 --- a/src/cmd/troff/n3.c +++ b/src/cmd/troff/n3.c @@ -1,6 +1,6 @@ /* * troff3.c - * + * * macro and string routines, storage allocation */ @@ -137,7 +137,7 @@ void maddhash(Contab *rp) } void munhash(Contab *mp) -{ +{ Contab *p; Contab **lp; @@ -326,7 +326,7 @@ Offset finds(int mn) if (contabp[i].rq == 0) break; } - if (i == nm) + if (i == nm) growcontab(); freeslot = i + 1; if ((nextb = alloc()) == -1) { @@ -531,7 +531,7 @@ Tchar rbf(void) /* return next char from blist[] block */ else return(popi()); } - + i = rbf0(ip); if (i == 0) { if (!app) @@ -596,9 +596,9 @@ Offset pushi(Offset newip, int mname) lastpbp = pbp; pendt = ch = 0; frame = nxf; - if (nxf->nargs == 0) + if (nxf->nargs == 0) nxf += 1; - else + else nxf = (Stack *)argtop; return(ip = newip); } @@ -624,7 +624,7 @@ int getsn(void) return(0); if (i == '(') return(getrq()); - else + else return(i); } @@ -698,7 +698,7 @@ void collect(void) quote = 0; if (cbits(i = getch()) == '"') quote++; - else + else ch = i; while (1) { i = getch(); @@ -850,7 +850,7 @@ void casetl(void) if (ismot(delim = getch())) { ch = delim; delim = '\''; - } else + } else delim = cbits(delim); tp = buf; numtabp[HP].val = 0; @@ -932,7 +932,7 @@ void casepm(void) tcnt++; j = contabp[i].mx; for (k = 1; (j = blist[bindex(j)].nextoff) != -1; ) - k++; + k++; cnt++; kk += k; if (!tot) diff --git a/src/cmd/troff/n4.c b/src/cmd/troff/n4.c index a1abe943..08e06ad3 100644 --- a/src/cmd/troff/n4.c +++ b/src/cmd/troff/n4.c @@ -123,7 +123,7 @@ void setn(void) i = ls; break; case 'R': /* maximal # of regs that can be addressed */ - i = 255*256 - regcnt; + i = 255*256 - regcnt; break; case 'z': p = unpair(dip->curd); @@ -137,7 +137,7 @@ void setn(void) cpushback(cfname[ifi]); return; case 'S': - buf[0] = j = 0; + buf[0] = j = 0; for( i = 0; tabtab[i] != 0 && i < NTAB; i++) { if (i > 0) buf[j++] = ' '; diff --git a/src/cmd/troff/n5.c b/src/cmd/troff/n5.c index 72664327..eab395fe 100644 --- a/src/cmd/troff/n5.c +++ b/src/cmd/troff/n5.c @@ -1,6 +1,6 @@ /* * troff5.c - * + * * misc processing requests */ @@ -30,16 +30,16 @@ void casead(void) case 'c': /*centered adj*/ admod = 1; break; - case 'b': + case 'b': case 'n': admod = 0; break; - case '0': - case '2': + case '0': + case '2': case '4': ad = 0; - case '1': - case '3': + case '1': + case '3': case '5': admod = (i - '0') / 2; } @@ -87,7 +87,7 @@ chget(int c) if (skip() || ismot(i = getch()) || cbits(i) == ' ' || cbits(i) == '\n') { ch = i; return(c); - } else + } else return cbits(i); /* was (i & BYTEMASK) */ } @@ -148,7 +148,7 @@ max(int aa, int bb) { if (aa > bb) return(aa); - else + else return(bb); } @@ -278,7 +278,7 @@ void casepl(void) skip(); if ((i = vnumb(&pl)) == 0) pl = 11 * INCH; /*11in*/ - else + else pl = i; if (numtabp[NL].val > pl) numtabp[NL].val = pl; @@ -321,7 +321,7 @@ void casech(void) skip(); if (!(j = getrq())) return; - else + else for (k = 0; k < NTRAP; k++) if (mlist[k] == j) break; @@ -399,7 +399,7 @@ void casefm(void) ERROR "fm: missing filename" WARN; return; } - + for (i = 0; i < 15 && fcache[i].fp != NULL; i++) { if (strcmp(nextf, fcache[i].name) == 0) break; @@ -418,7 +418,7 @@ void casefm(void) casetm1(0, fcache[i].fp); } -void casetm1(int ab, FILE *out) +void casetm1(int ab, FILE *out) { int i, j, c; char *p; @@ -444,7 +444,7 @@ void casetm1(int ab, FILE *out) trace = savtrac; } } else - skip(); + skip(); for (i = 0; i < NTM - 2; ) { if ((c = cbits(getch())) == '\n' || c == RIGHT) break; @@ -517,7 +517,7 @@ void casesp1(int a) j = vnumb((int *)0); if (nonumb) j = lss; - } else + } else j = a; if (j == 0) return; @@ -525,8 +525,8 @@ void casesp1(int a) j = i; savlss = lss; if (dip != d) - i = dip->dnl; - else + i = dip->dnl; + else i = numtabp[NL].val; if ((i + j) < 0) j = -i; @@ -542,8 +542,8 @@ void casert(void) skip(); if (dip != d) - p = &dip->dnl; - else + p = &dip->dnl; + else p = &numtabp[NL].val; a = vnumb(p); if (nonumb) @@ -594,7 +594,7 @@ e0: ERROR "cannot do .ev %d", nxev WARN; if (error) done2(040); - else + else edone(040); return; } @@ -840,7 +840,7 @@ rdtty(void) if (read(0, &onechar, 1) == 1) { if (onechar == '\n') tty++; - else + else tty = 1; if (tty != 3) return(onechar); @@ -878,7 +878,7 @@ void caseta(void) j = TABMASK; } tabtab[i] = j & TABMASK; - if (!nonumb) + if (!nonumb) switch (cbits(ch)) { case 'C': tabtab[i] |= CTAB; @@ -976,7 +976,7 @@ void caseuf(void) if (skip() || !(i = getrq()) || i == 'S' || (j = findft(i)) == -1) ulfont = ULFONT; /*default underline position*/ - else + else ulfont = j; if (NROFF && ulfont == FT) ulfont = ULFONT; @@ -1022,8 +1022,8 @@ void casemk(void) int i, j; if (dip != d) - j = dip->dnl; - else + j = dip->dnl; + else j = numtabp[NL].val; if (skip()) { dip->mkline = j; diff --git a/src/cmd/troff/n6.c b/src/cmd/troff/n6.c index 69d48f2e..d44e67da 100644 --- a/src/cmd/troff/n6.c +++ b/src/cmd/troff/n6.c @@ -139,7 +139,7 @@ void n_setfont(int a) if (a) i = getrq(); - else + else i = getsn(); if (!i || i == 'P') { j = font1; @@ -188,7 +188,7 @@ void n_setwd(void) k = -k; base -= k; emsz = 0; - } else + } else continue; if (base < numtabp[SB].val) numtabp[SB].val = base; @@ -300,7 +300,7 @@ bd0: if (skip() || !(i = getrq()) || (j = findft(i)) == -1) { if (k) goto bd1; - else + else return; } if (j == smnt) { diff --git a/src/cmd/troff/n7.c b/src/cmd/troff/n7.c index 15bcfd5b..414563c0 100644 --- a/src/cmd/troff/n7.c +++ b/src/cmd/troff/n7.c @@ -15,7 +15,7 @@ Tchar gettch(void); /* * troff7.c - * + * * text */ @@ -73,8 +73,8 @@ void tbreak(void) horiz(un); if (NROFF) { if (adrem % t.Adj) - resol = t.Hor; - else + resol = t.Hor; + else resol = t.Adj; } else resol = HOR; @@ -113,7 +113,7 @@ void tbreak(void) } if (icf) icf++; - else + else ic = 0; ne = nwd = 0; un = in; @@ -168,7 +168,7 @@ void text(void) nflush++; numtabp[HP].val = 0; if ((dip == d) && (numtabp[NL].val == -1)) { - newline(1); + newline(1); return; } setnel(); @@ -180,8 +180,8 @@ void text(void) goto t4; if (pendt) if (spcnt) - goto t2; - else + goto t2; + else goto t3; pendt++; if (spcnt) @@ -226,8 +226,8 @@ t5: adsp = adrem = 0; if (ad) { if (nwd == 1) - adsp = nel; - else + adsp = nel; + else adsp = nel / (nwd - 1); adsp = (adsp / HOR) * HOR; adrem = nel - adsp*(nwd-1); @@ -300,8 +300,8 @@ void callsp(void) int i; if (flss) - i = flss; - else + i = flss; + else i = lss; flss = 0; casesp1(i); @@ -379,7 +379,7 @@ void newline(int a) } if (dip->ditrap && !dip->ditf && dip->dnl >= dip->ditrap && dip->dimac) if (control(dip->dimac, 0)) { - trap++; + trap++; dip->ditf++; } return; @@ -514,7 +514,7 @@ findt1(void) if (dip != d) i = dip->dnl; - else + else i = numtabp[NL].val; return(findt(i)); } @@ -529,7 +529,7 @@ void eject(Stack *a) ejf++; if (a) ejl = a; - else + else ejl = frame; if (trap) return; diff --git a/src/cmd/troff/n8.c b/src/cmd/troff/n8.c index 9ff2ebce..92c42724 100644 --- a/src/cmd/troff/n8.c +++ b/src/cmd/troff/n8.c @@ -11,7 +11,7 @@ /* * troff8.c - * + * * hyphenation */ @@ -59,7 +59,7 @@ void hyphen(Tchar *wp) /* this appears to sort hyphenation points into increasing order */ *hyp++ = 0; - if (*hyptr) + if (*hyptr) for (j = 1; j; ) { j = 0; for (hyp = hyptr + 1; *hyp != 0; hyp++) { @@ -194,7 +194,7 @@ int exword(void) return(0); w = wdstart; while (*e && w <= hyend && (*e & 0177) == maplow(cbits(*w))) { - e++; + e++; w++; } if (!*e) { @@ -209,10 +209,10 @@ int exword(void) } return(1); } else { - e++; + e++; continue; } - } else + } else while (*e++) ; } @@ -249,7 +249,7 @@ again: } s = s0 + i - 1; w = hyend; - if (*s0 & HY_BIT) + if (*s0 & HY_BIT) goto mark; while (s > s0) { w--; @@ -273,7 +273,7 @@ mark: int maplow(int i) { - if (isupper(i)) + if (isupper(i)) i = tolower(i); return(i); } @@ -327,7 +327,7 @@ again: val *= dilook('a', cbits(*w), bxh); else if (w == wdstart + 1) val *= dilook(cbits(*(w-1)), cbits(*w), bxxh); - else + else val *= dilook(cbits(*(w-1)), cbits(*w), xxh); val *= dilook(cbits(*w), cbits(*(w+1)), xhx); val *= dilook(cbits(*(w+1)), cbits(*(w+2)), hxx); diff --git a/src/cmd/troff/n9.c b/src/cmd/troff/n9.c index 3e3ad97f..7c09de02 100644 --- a/src/cmd/troff/n9.c +++ b/src/cmd/troff/n9.c @@ -4,7 +4,7 @@ /* * troff9.c - * + * * misc functions */ @@ -115,7 +115,7 @@ void setov(void) } } } - else + else return; *pbp++ = makem(w[0] / 2); for (k = 0; o[k]; k++) @@ -187,7 +187,7 @@ void setvline(void) } if ((cbits(c = getch())) == delim) { c = BOXRULE | chbits; /*default box rule*/ - } else + } else getch(); c |= ZBIT; neg = 0; @@ -342,9 +342,9 @@ Tchar setfield(int x) static Tchar wbuf[] = { WORDSP, 0}; rchar = 0; - if (x == tabch) + if (x == tabch) rchar = tabc | chbits; - else if (x == ldrch) + else if (x == ldrch) rchar = dotc | chbits; temp = npad = ws = 0; savfc = fc; @@ -381,7 +381,7 @@ Tchar setfield(int x) if (pp > padptr + NPP - 1) break; goto s1; - } else if (j == savfc) + } else if (j == savfc) break; else if (j == '\n') { temp = j; @@ -435,7 +435,7 @@ s1: } if (length) jj = length | MOT; - else + else jj = getch0(); if (savepos > 0) pushback(wbuf); @@ -448,14 +448,14 @@ s1: numtabp[HP].val += jj; widthp = jj; *fp++ = ii; - if (fp > fbuf + FBUFSZ - 3) + if (fp > fbuf + FBUFSZ - 3) break; } *fp++ = ii; *fp = 0; if (type == RTAB) length -= ws; - else + else length -= ws / 2; /*CTAB*/ pushback(fbuf); if ((j = width(rchar)) != 0 && length > 0) { diff --git a/src/cmd/troff/ni.c b/src/cmd/troff/ni.c index ee09ed4a..e12a3a08 100644 --- a/src/cmd/troff/ni.c +++ b/src/cmd/troff/ni.c @@ -387,4 +387,3 @@ void (*ptpause)(void); void (*setfont)(int a); void (*setps)(void); void (*setwd)(void); - diff --git a/src/cmd/troff/t10.c b/src/cmd/troff/t10.c index b037bdda..0c772524 100644 --- a/src/cmd/troff/t10.c +++ b/src/cmd/troff/t10.c @@ -4,7 +4,7 @@ /* * troff10.c - * + * * typesetter interface */ @@ -169,7 +169,7 @@ int ptout0(Tchar *pi) j = -j; if (isvmot(i)) lead += j; - else + else esc += j; return(outsize); } @@ -191,7 +191,7 @@ int ptout0(Tchar *pi) if (sfbits(i) == oldbits) { xfont = pfont; xpts = ppts; - } else + } else xbits(i, 2); if (k == XON) { extern int xon; @@ -232,8 +232,8 @@ int ptout0(Tchar *pi) } if (iszbit(i)) { if (cs) - w = -j; - else + w = -j; + else w = 0; z = 1; } diff --git a/src/cmd/troff/t11.c b/src/cmd/troff/t11.c index f930d8b1..9cd831c9 100644 --- a/src/cmd/troff/t11.c +++ b/src/cmd/troff/t11.c @@ -50,7 +50,7 @@ getdesc(char *name) chadd(s, Troffchar, Install); break; } - /* else + /* else just skip anything else */ skipline(fin); } @@ -83,7 +83,7 @@ static int checkfont(char *name) } fclose(fp); return status; - + } int diff --git a/src/cmd/troff/t6.c b/src/cmd/troff/t6.c index 4a2bd024..3a2d8d85 100644 --- a/src/cmd/troff/t6.c +++ b/src/cmd/troff/t6.c @@ -1,6 +1,6 @@ /* * t6.c - * + * * width functions, sizes and fonts */ @@ -46,7 +46,7 @@ t_width(Tchar j) if (sfbits(j) == oldbits) { xfont = pfont; xpts = ppts; - } else + } else xbits(j, 0); if (i < nchnames + ALPHABET && widcache[i].fontpts == (xfont<<8) + xpts && !setwdf) k = widcache[i].width; @@ -129,7 +129,7 @@ getcw(int i) if (setwdf) numtabp[CT].val |= fp->wp[n].kern; } else if (n == -2) { /* \N with default width */ - + k = fp->defaultwidth; } else { /* not on current font */ nocache = 1; @@ -153,8 +153,8 @@ getcw(int i) if (cs = cstab[xfont]) { nocache = 1; if (ccs = ccstab[xfont]) - x = ccs; - else + x = ccs; + else x = xpts; cs = (cs * EMPTS(x)) / 36; } @@ -247,7 +247,7 @@ Tchar t_setch(int c) return j | chbits; } else return chadd(temp, Troffchar, Install) | chbits; /* add name even if haven't seen it */ - + #endif /*UNICODE*/ } @@ -488,7 +488,7 @@ void t_setfont(int a) if (a) i = getrq(); - else + else i = getsn(); if (!i || i == 'P') { j = font1; @@ -538,7 +538,7 @@ void t_setwd(void) k = -k; base -= k; emsz = 0; - } else + } else continue; if (base < numtabp[SB].val) numtabp[SB].val = base; @@ -654,7 +654,7 @@ Tchar getlg(Tchar i) *pbp++ = k; j = LIG_FF; } - } else + } else j = LIG_FF; } else { *pbp++ = j; @@ -694,7 +694,7 @@ void casefp(void) if (i <= 0 || i > nfonts) ERROR "fp: bad font position %d", i WARN; else if (skip() || !(j = getrq())) - ERROR "fp: no font name" WARN; + ERROR "fp: no font name" WARN; else if (skip() || !getname()) setfp(i, j, (char*) 0, 1); else /* 3rd argument = filename */ @@ -723,15 +723,15 @@ setfp(int pos, int f, char *truename, int print) /* mount font f at position pos else strcpy(shortname, (char *) unpair(f)); if (truename && strrchr(truename, '/')) { /* .fp 1 R dir/file: use verbatim */ - sprintf(pathname, "%s", truename); + snprintf(pathname, NS, "%s", truename); if (fonts[pos].truename) free(fonts[pos].truename); fonts[pos].truename = strdupl(truename); } else if (truename) { /* synonym: .fp 1 R Avant */ - sprintf(pathname, "%s/dev%s/%s", fontdir, devname, truename); + snprintf(pathname, NS, "%s/dev%s/%s", fontdir, devname, truename); truename = 0; /* so doesn't get repeated by ptfpcmd */ } else /* vanilla: .fp 5 XX */ - sprintf(pathname, "%s/dev%s/%s", fontdir, devname, shortname); + snprintf(pathname, NS, "%s/dev%s/%s", fontdir, devname, shortname); if (truename == 0 && fonts[pos].truename != 0) { free(fonts[pos].truename); fonts[pos].truename = 0; @@ -745,8 +745,8 @@ setfp(int pos, int f, char *truename, int print) /* mount font f at position pos ptfont(); } if (pos == smnt) { - smnt = 0; - sbold = 0; + smnt = 0; + sbold = 0; } fontlab[pos] = f; if (smnt == 0 && fonts[pos].specfont) @@ -801,7 +801,7 @@ bd0: if (skip() || !(i = getrq()) || (j = findft(i)) == -1) { if (k) goto bd1; - else + else return; } if (j == smnt) { @@ -836,7 +836,7 @@ void casevs(void) i = inumb(&lss); if (nonumb) i = lss1; - if (i < VERT) + if (i < VERT) i = VERT; lss1 = lss; lss = i; diff --git a/src/cmd/troff/tdef.h b/src/cmd/troff/tdef.h index 25c9270c..4e6a4976 100644 --- a/src/cmd/troff/tdef.h +++ b/src/cmd/troff/tdef.h @@ -102,7 +102,7 @@ extern char errbuf[]; /* 0 and 040 don't have any graphic or other function. /* The few that do have a purpose (e.g., \n, \b, \t, ... /* are avoided by the ad hoc choices here. -/* See ifilt[] in n1.c for others -- 1, 2, 3, 5, 6, 7, 010, 011, 012 +/* See ifilt[] in n1.c for others -- 1, 2, 3, 5, 6, 7, 010, 011, 012 */ #define LEADER 001 @@ -189,7 +189,7 @@ extern char errbuf[]; /* 128 for parochial USA 7-bit ascii, */ /* 256 for "European" mode with e.g., Latin-1 */ - /* NCHARS must be greater than + /* NCHARS must be greater than ALPHABET (ascii stuff) + total number of distinct char names from all fonts that will be run in this job (including unnamed ones and \N's) @@ -303,13 +303,13 @@ extern Spnames spnames[]; error. In this version, the array is represented by a list of blocks, pointed to by blist[].bp. Each block is of size BLK Tchars, and BLK MUST be a power of 2 for the macros below to work. - + The blocks associated with a particular string or macro are chained together in the array blist[]. Each blist[i].nextoff contains the Offset associated with the next block in the giant array, or -1 if this is the last block in the chain. If .nextoff is 0, the block is free. - + To find the right index in blist for an Offset, divide by BLK. */ |