home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume35 / lprps / patch02 < prev    next >
Encoding:
Text File  |  1993-03-03  |  3.8 KB  |  160 lines

  1. Newsgroups: comp.sources.misc
  2. From: jjc@jclark.com (James Clark)
  3. Subject: v35i111:  lprps - interface lpr to a PostScript printer, Patch02
  4. Message-ID: <1993Mar3.185016.19676@sparky.imd.sterling.com>
  5. X-Md4-Signature: 9b78a3ed2cbd49e8ab4f724721d83597
  6. Date: Wed, 3 Mar 1993 18:50:16 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: jjc@jclark.com (James Clark)
  10. Posting-number: Volume 35, Issue 111
  11. Archive-name: lprps/patch02
  12. Environment: BSD, SUNOS
  13. Patch-To: lprps: Volume 31, Issue 77-78
  14.  
  15. This patch updates lprps version 2.4 to version 2.5.  It makes psif
  16. ignore an initial Ctrl-D; this is useful when acting as a print server
  17. for a machine running Microsoft Windows.
  18.  
  19. James Clark
  20. jjc@jclark.com
  21.  
  22. Prereq: 2.4.
  23. diff -rc2N lprps-2.4/README lprps-2.5/README
  24. *** lprps-2.4/README    Tue Sep 29 10:15:48 1992
  25. --- lprps-2.5/README    Mon Feb 22 12:46:06 1993
  26. ***************
  27. *** 1,3 ****
  28. ! This is lprps version 2.4.
  29.   
  30.   lprps is a collection of programs for using lpr with a PostScript
  31. --- 1,3 ----
  32. ! This is lprps version 2.5.
  33.   
  34.   lprps is a collection of programs for using lpr with a PostScript
  35. ***************
  36. *** 58,60 ****
  37.   jjc@jclark.com
  38.   
  39. ! $Id: README,v 1.13 1992/09/29 09:14:36 jjc Exp $
  40. --- 58,60 ----
  41.   jjc@jclark.com
  42.   
  43. ! $Id: README,v 1.14 1993/02/22 12:43:37 jjc Exp $
  44. diff -rc2N lprps-2.4/lprps.c lprps-2.5/lprps.c
  45. *** lprps-2.4/lprps.c    Tue Sep 29 10:15:52 1992
  46. --- lprps-2.5/lprps.c    Mon Feb 22 12:46:10 1993
  47. ***************
  48. *** 2,6 ****
  49.   
  50.   #ifndef lint
  51. ! static char rcsid[] = "$Id: lprps.c,v 1.19 1992/09/29 09:06:22 jjc Exp $";
  52.   #endif
  53.   
  54. --- 2,6 ----
  55.   
  56.   #ifndef lint
  57. ! static char rcsid[] = "$Id: lprps.c,v 1.20 1993/02/22 12:44:26 jjc Exp $";
  58.   #endif
  59.   
  60. ***************
  61. *** 22,25 ****
  62. --- 22,31 ----
  63.   #endif
  64.   
  65. + #ifdef __STDC__
  66. + #define VOLATILE volatile
  67. + #else
  68. + #define VOLATILE /* as nothing */
  69. + #endif
  70.   #define SENDMAIL "/usr/lib/sendmail"
  71.   
  72. ***************
  73. *** 51,57 ****
  74.   int mail_pid = -1;
  75.   /* set to non-zero on interrupt */
  76. ! int interrupt_flag = 0;
  77.   /* set to non-zero on timeout */
  78. ! int timeout_flag = 0;
  79.   /* if non-zero exit on timeout */
  80.   int exit_on_timeout = 0;
  81. --- 57,63 ----
  82.   int mail_pid = -1;
  83.   /* set to non-zero on interrupt */
  84. ! VOLATILE int interrupt_flag = 0;
  85.   /* set to non-zero on timeout */
  86. ! VOLATILE int timeout_flag = 0;
  87.   /* if non-zero exit on timeout */
  88.   int exit_on_timeout = 0;
  89. ***************
  90. *** 655,659 ****
  91.       sys_error("read");
  92.     if (nread == 0)
  93. !     sys_error("read returned 0");
  94.     while (--nread >= 0)
  95.       process_input_char(*p++);
  96. --- 661,665 ----
  97.       sys_error("read");
  98.     if (nread == 0)
  99. !     error("read unexpectedly returned 0");
  100.     while (--nread >= 0)
  101.       process_input_char(*p++);
  102. diff -rc2N lprps-2.4/psif.c lprps-2.5/psif.c
  103. *** lprps-2.4/psif.c    Tue Sep 29 10:15:52 1992
  104. --- lprps-2.5/psif.c    Mon Feb 22 12:46:10 1993
  105. ***************
  106. *** 2,6 ****
  107.   
  108.   #ifndef lint
  109. ! static char rcsid[] = "$Id: psif.c,v 1.7 1992/02/01 12:40:34 jjc Exp $";
  110.   #endif
  111.   
  112. --- 2,6 ----
  113.   
  114.   #ifndef lint
  115. ! static char rcsid[] = "$Id: psif.c,v 1.8 1993/02/22 12:37:51 jjc Exp $";
  116.   #endif
  117.   
  118. ***************
  119. *** 41,44 ****
  120. --- 41,45 ----
  121.   {
  122.     char buf[BUFSIZ];
  123. +   char *bufp = buf;
  124.     char *command;
  125.     int nread = 0;
  126. ***************
  127. *** 63,67 ****
  128.       exit(EXIT_THROW_AWAY);
  129.     }
  130. !   if (nread < 2 || buf[0] != '%' || buf[1] != '!')
  131.       command = TEXT_FILTER;
  132.     else
  133. --- 64,73 ----
  134.       exit(EXIT_THROW_AWAY);
  135.     }
  136. !   /* Ignore initial Ctrl-D. */
  137. !   if (nread > 0 && buf[0] == '\004') {
  138. !     bufp++;
  139. !     nread--;
  140. !   }
  141. !   if (nread < 2 || bufp[0] != '%' || bufp[1] != '!')
  142.       command = TEXT_FILTER;
  143.     else
  144. ***************
  145. *** 84,88 ****
  146.         d = fd[1];
  147.         if (nread != 0) {
  148. !     if (write(d, buf, nread) < 0)
  149.         sys_error("write");
  150.       if (!eof) {
  151. --- 90,94 ----
  152.         d = fd[1];
  153.         if (nread != 0) {
  154. !     if (write(d, bufp, nread) < 0)
  155.         sys_error("write");
  156.       if (!eof) {
  157.  
  158. exit 0 # Just in case...
  159.