Add define for Kirk Smith's USR Courier driver. Change default baud
[unix-history] / usr / src / usr.bin / window / wwpty.c
index b5c6467..0919d52 100644 (file)
@@ -1,7 +1,13 @@
 #ifndef lint
 #ifndef lint
-static char *sccsid = "@(#)wwpty.c     3.8 84/04/15";
+static char sccsid[] = "@(#)wwpty.c    3.11 %G%";
 #endif
 
 #endif
 
+/*
+ * Copyright (c) 1983 Regents of the University of California,
+ * All rights reserved.  Redistribution permitted subject to
+ * the terms of the Berkeley Software License Agreement.
+ */
+
 #include "ww.h"
 
 /*
 #include "ww.h"
 
 /*
@@ -16,7 +22,7 @@ register struct ww *w;
        register int i;
        int tty;
        int on = 1;
        register int i;
        int tty;
        int on = 1;
-       int count = -1;
+       char hasq = 0;
 #define PTY "/dev/XtyXX"
 #define _PT    5
 #define _PQRS  8
 #define PTY "/dev/XtyXX"
 #define _PT    5
 #define _PQRS  8
@@ -29,9 +35,9 @@ register struct ww *w;
                w->ww_ttyname[_0_9] = '0';
                if (access(w->ww_ttyname, 0) < 0)
                        continue;
                w->ww_ttyname[_0_9] = '0';
                if (access(w->ww_ttyname, 0) < 0)
                        continue;
-               if (count < 0 && (count = c - 'p' - 1) == 0)
-                       count = 1;
-               if (--count < 0)
+               if (c != 'p')
+                       hasq = 1;
+               else if (hasq)
                        break;
                for (i = 15; i >= 0; i--) {
                        w->ww_ttyname[_PT] = 'p';
                        break;
                for (i = 15; i >= 0; i--) {
                        w->ww_ttyname[_PT] = 'p';