fixed several bugs.
authorRalph Campbell <ralph@ucbvax.Berkeley.EDU>
Wed, 2 Mar 1983 03:22:53 +0000 (19:22 -0800)
committerRalph Campbell <ralph@ucbvax.Berkeley.EDU>
Wed, 2 Mar 1983 03:22:53 +0000 (19:22 -0800)
SCCS-vsn: usr.sbin/lpr/filters/lpf.c 4.6
SCCS-vsn: usr.sbin/lpr/lpr/lpr.c 4.9

usr/src/usr.sbin/lpr/filters/lpf.c
usr/src/usr.sbin/lpr/lpr/lpr.c

index 0f5c6fd..e173cd8 100644 (file)
@@ -1,4 +1,4 @@
-/*             lpf.c   4.5     83/02/10
+/*             lpf.c   4.6     83/03/01
  *     filter which reads the output of nroff and converts lines
  *     with ^H's to overwritten lines.  Thus this works like 'ul'
  *     but is much better: it can handle more than 2 overwrites
  *     filter which reads the output of nroff and converts lines
  *     with ^H's to overwritten lines.  Thus this works like 'ul'
  *     but is much better: it can handle more than 2 overwrites
@@ -37,11 +37,6 @@ main()
                                ch = '\n';
                                break;
 
                                ch = '\n';
                                break;
 
-                       case '\031':
-                               fflush(stdout);
-                               kill(getpid(), SIGSTOP);
-                               break;
-
                        case '\f':
                        case '\n':
                                linedone = 1;
                        case '\f':
                        case '\n':
                                linedone = 1;
@@ -60,6 +55,23 @@ main()
                                col = (col | 07) + 1;
                                break;
 
                                col = (col | 07) + 1;
                                break;
 
+#ifdef WAITCHAR
+                       case '\031':
+                               /*
+                                * lpd needs to use a different filter to
+                                * print data so stop what we are doing and
+                                * wait for lpd to restart us.
+                                */
+                               if ((ch = getchar()) == '\1') {
+                                       fflush(stdout);
+                                       kill(getpid(), SIGSTOP);
+                                       break;
+                               } else {
+                                       ungetc(ch, stdin);
+                                       ch = '\031';
+                               }
+#endif
+
                        default:
                                if (col >= MAXWIDTH)
                                        break;
                        default:
                                if (col >= MAXWIDTH)
                                        break;
index ad4d713..bcf3aa5 100644 (file)
@@ -55,7 +55,7 @@
 
 char lpr_id[] = "~|^`lpr.c:\t4.2\t1 May 1981\n";
 
 
 char lpr_id[] = "~|^`lpr.c:\t4.2\t1 May 1981\n";
 
-/*     lpr.c   4.8     83/02/11        */
+/*     lpr.c   4.9     83/03/01        */
 /*
  *      lpr -- off line print
  *
 /*
  *      lpr -- off line print
  *