From: Brian McCauley (mccauleyba@vax1.bham.ac.uk)
Date: 06/09/93


From: mccauleyba@vax1.bham.ac.uk (Brian McCauley)
Subject: Patch to fix ``lpr -p''
Date: 9 Jun 1993 19:28:35 GMT

The following is from the just relased copy of the lpd-FAQ. I've been trying
to mail it to Fred van _something_I_forget_ but the E-mail address I've
given in the lpd-FAQ for him is no good. Could someone who has full net-2
sources test out this patch. I'll get all the stuff myself eventually but
I have a bit of a bandwidth problem. If anyone on the net-2 team wants
to incorporate this patch into the released version (provided it
works) then that would be better still.

================[ Begin Quote ]===================
QUESTION: Why doesn't `lpr -p' work?

ANSWER: Because it's broken. lpd always thinks that the printer is 0
characters wide regardless of what printcap says. This is still broken
in Ross's new release and Fred's port of the '91 sources. Looking at the
sources the fix for Fred's port appears to be:

===============================Cut Here=====================================
*** printjob.c.old Sat Feb 27 14:07:01 1993
--- printjob.c Sun Jun 6 11:02:36 1993
***************
*** 265,271 ****
         */
        for (i = 0; i < 4; i++)
                strcpy(fonts[i], ifonts[i]);
! strcpy(width+2, "0");
        strcpy(indent+2, "0");
  
        /*
--- 265,271 ----
         */
        for (i = 0; i < 4; i++)
                strcpy(fonts[i], ifonts[i]);
! sprintf(&width[2], "%d", PW);
        strcpy(indent+2, "0");
  
        /*
***************
*** 1081,1087 ****
                FF = DEFFF;
        if ((PW = pgetnum("pw")) < 0)
                PW = DEFWIDTH;
- sprintf(&width[2], "%d", PW);
        if ((PL = pgetnum("pl")) < 0)
                PL = DEFLENGTH;
        sprintf(&length[2], "%d", PL);
--- 1081,1086 ----
==================================Cut Here==============================

This patch is untested as I don't have a complete set of net-2 include
files on my machine yet.
============[ End Quote ]=================