home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sources.misc
- From: jjc@jclark.com (James Clark)
- Subject: v35i111: lprps - interface lpr to a PostScript printer, Patch02
- Message-ID: <1993Mar3.185016.19676@sparky.imd.sterling.com>
- X-Md4-Signature: 9b78a3ed2cbd49e8ab4f724721d83597
- Date: Wed, 3 Mar 1993 18:50:16 GMT
- Approved: kent@sparky.imd.sterling.com
-
- Submitted-by: jjc@jclark.com (James Clark)
- Posting-number: Volume 35, Issue 111
- Archive-name: lprps/patch02
- Environment: BSD, SUNOS
- Patch-To: lprps: Volume 31, Issue 77-78
-
- This patch updates lprps version 2.4 to version 2.5. It makes psif
- ignore an initial Ctrl-D; this is useful when acting as a print server
- for a machine running Microsoft Windows.
-
- James Clark
- jjc@jclark.com
-
- Prereq: 2.4.
- diff -rc2N lprps-2.4/README lprps-2.5/README
- *** lprps-2.4/README Tue Sep 29 10:15:48 1992
- --- lprps-2.5/README Mon Feb 22 12:46:06 1993
- ***************
- *** 1,3 ****
- ! This is lprps version 2.4.
-
- lprps is a collection of programs for using lpr with a PostScript
- --- 1,3 ----
- ! This is lprps version 2.5.
-
- lprps is a collection of programs for using lpr with a PostScript
- ***************
- *** 58,60 ****
- jjc@jclark.com
-
- ! $Id: README,v 1.13 1992/09/29 09:14:36 jjc Exp $
- --- 58,60 ----
- jjc@jclark.com
-
- ! $Id: README,v 1.14 1993/02/22 12:43:37 jjc Exp $
- diff -rc2N lprps-2.4/lprps.c lprps-2.5/lprps.c
- *** lprps-2.4/lprps.c Tue Sep 29 10:15:52 1992
- --- lprps-2.5/lprps.c Mon Feb 22 12:46:10 1993
- ***************
- *** 2,6 ****
-
- #ifndef lint
- ! static char rcsid[] = "$Id: lprps.c,v 1.19 1992/09/29 09:06:22 jjc Exp $";
- #endif
-
- --- 2,6 ----
-
- #ifndef lint
- ! static char rcsid[] = "$Id: lprps.c,v 1.20 1993/02/22 12:44:26 jjc Exp $";
- #endif
-
- ***************
- *** 22,25 ****
- --- 22,31 ----
- #endif
-
- + #ifdef __STDC__
- + #define VOLATILE volatile
- + #else
- + #define VOLATILE /* as nothing */
- + #endif
- +
- #define SENDMAIL "/usr/lib/sendmail"
-
- ***************
- *** 51,57 ****
- int mail_pid = -1;
- /* set to non-zero on interrupt */
- ! int interrupt_flag = 0;
- /* set to non-zero on timeout */
- ! int timeout_flag = 0;
- /* if non-zero exit on timeout */
- int exit_on_timeout = 0;
- --- 57,63 ----
- int mail_pid = -1;
- /* set to non-zero on interrupt */
- ! VOLATILE int interrupt_flag = 0;
- /* set to non-zero on timeout */
- ! VOLATILE int timeout_flag = 0;
- /* if non-zero exit on timeout */
- int exit_on_timeout = 0;
- ***************
- *** 655,659 ****
- sys_error("read");
- if (nread == 0)
- ! sys_error("read returned 0");
- while (--nread >= 0)
- process_input_char(*p++);
- --- 661,665 ----
- sys_error("read");
- if (nread == 0)
- ! error("read unexpectedly returned 0");
- while (--nread >= 0)
- process_input_char(*p++);
- diff -rc2N lprps-2.4/psif.c lprps-2.5/psif.c
- *** lprps-2.4/psif.c Tue Sep 29 10:15:52 1992
- --- lprps-2.5/psif.c Mon Feb 22 12:46:10 1993
- ***************
- *** 2,6 ****
-
- #ifndef lint
- ! static char rcsid[] = "$Id: psif.c,v 1.7 1992/02/01 12:40:34 jjc Exp $";
- #endif
-
- --- 2,6 ----
-
- #ifndef lint
- ! static char rcsid[] = "$Id: psif.c,v 1.8 1993/02/22 12:37:51 jjc Exp $";
- #endif
-
- ***************
- *** 41,44 ****
- --- 41,45 ----
- {
- char buf[BUFSIZ];
- + char *bufp = buf;
- char *command;
- int nread = 0;
- ***************
- *** 63,67 ****
- exit(EXIT_THROW_AWAY);
- }
- ! if (nread < 2 || buf[0] != '%' || buf[1] != '!')
- command = TEXT_FILTER;
- else
- --- 64,73 ----
- exit(EXIT_THROW_AWAY);
- }
- ! /* Ignore initial Ctrl-D. */
- ! if (nread > 0 && buf[0] == '\004') {
- ! bufp++;
- ! nread--;
- ! }
- ! if (nread < 2 || bufp[0] != '%' || bufp[1] != '!')
- command = TEXT_FILTER;
- else
- ***************
- *** 84,88 ****
- d = fd[1];
- if (nread != 0) {
- ! if (write(d, buf, nread) < 0)
- sys_error("write");
- if (!eof) {
- --- 90,94 ----
- d = fd[1];
- if (nread != 0) {
- ! if (write(d, bufp, nread) < 0)
- sys_error("write");
- if (!eof) {
-
- exit 0 # Just in case...
-