bug in pr(1) - with fix

Mike Wescott wescott at sauron.Columbia.NCR.COM
Tue Feb 7 04:57:53 AEST 1989


If pr is used with an odd page length and double space
is specified, only the first page will get printed.

Fix:
*** /tmp/pr.c.orig	Mon Feb  6 10:44:14 1989
--- /tmp/pr.c	Mon Feb  6 10:46:06 1989
***************
*** 376,382 ****
  		p->c_ptr0 = p->c_ptr = s;
  		if (p == &Colpts[Ncols]) return;
  		(p++)->c_lno = Lnumb + bline;
! 		for (j = (Length - Margin)/Dblspace; --j >= 0; ++bline)
  			for (Inpos = 0; ; ) {
  				if ((c = getc(Files->f_f)) == EOF) {
  					for (*s = EOF; p <= &Colpts[Ncols]; ++p)
--- 376,382 ----
  		p->c_ptr0 = p->c_ptr = s;
  		if (p == &Colpts[Ncols]) return;
  		(p++)->c_lno = Lnumb + bline;
! 		for (j = (Length - Margin + Dblspace - 1)/Dblspace; --j >= 0; ++bline)
  			for (Inpos = 0; ; ) {
  				if ((c = getc(Files->f_f)) == EOF) {
  					for (*s = EOF; p <= &Colpts[Ncols]; ++p)
-- 
	-Mike Wescott
	 mike.wescott at ncrcae.Columbia.NCR.COM



More information about the Comp.bugs.sys5 mailing list