X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/2b84abb596f52ab2068d52108adc96838ad4340a..31cef89cb428866f787983e68246030321893df4:/usr/src/cmd/pr.c diff --git a/usr/src/cmd/pr.c b/usr/src/cmd/pr.c index 880661e8be..01509836a9 100644 --- a/usr/src/cmd/pr.c +++ b/usr/src/cmd/pr.c @@ -1,3 +1,4 @@ +static char *sccsid = "@(#)pr.c 4.1 (Berkeley) 10/1/80"; /* * print file with headings * 2+head+2+page[56]+5 @@ -8,6 +9,9 @@ #include #include +/* Making putcp a macro sped things up by 14%. */ +#define putcp(c) if (page >= fpage) putchar(c) + int ncol = 1; char *header; int col; @@ -34,6 +38,7 @@ int length = 66; int plength = 61; int margin = 10; int ntflg; +int fflg; int mflg; int tabc; char *tty; @@ -67,6 +72,11 @@ char **argv; ntflg++; continue; + case 'f': + fflg++; + plength = 60; + continue; + case 'l': length = atoi(++*argv); continue; @@ -200,14 +210,25 @@ char **argp; } line = 0; if (ntflg==0) { - sprintf(linebuf, "\n\n%s %s %s Page %d\n\n\n", - cbuf+4, cbuf+20, header, page); + if (fflg) { + /* Assume a ff takes two blank lines at the + top of the page. */ + line = 2; + sprintf(linebuf, "%s %s %s Page %d\n\n\n", + cbuf+4, cbuf+20, header, page); + } else + sprintf(linebuf, "\n\n%s %s %s Page %d\n\n\n", + cbuf+4, cbuf+20, header, page); for(cp=linebuf;*cp;) put(*cp++); } putpage(); - if (ntflg==0) - while(line= fpage) - putchar(c); -}