BSD 4_3_Reno release
[unix-history] / usr / src / games / cribbage / io.c
index 96f0494..4bb8061 100644 (file)
@@ -1,12 +1,25 @@
 /*
  * Copyright (c) 1980 Regents of the University of California.
 /*
  * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.  The Berkeley software License Agreement
- * specifies the terms and conditions for redistribution.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that: (1) source distributions retain this entire copyright
+ * notice and comment, and (2) distributions including binaries display
+ * the following acknowledgement:  ``This product includes software
+ * developed by the University of California, Berkeley and its contributors''
+ * in the documentation or other materials provided with the distribution
+ * and in all advertising materials mentioning features or use of this
+ * software. Neither the name of the University nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)io.c       5.2 (Berkeley) %G%";
-#endif not lint
+static char sccsid[] = "@(#)io.c       5.6 (Berkeley) 6/1/90";
+#endif /* not lint */
 
 # include      <curses.h>
 # include      <ctype.h>
 
 # include      <curses.h>
 # include      <ctype.h>
@@ -491,8 +504,10 @@ readchar()
 over:
     cnt = 0;
     while (read(0, &c, 1) <= 0)
 over:
     cnt = 0;
     while (read(0, &c, 1) <= 0)
-       if (cnt++ > 100)        /* if we are getting infinite EOFs */
-           bye();              /* quit the game */
+       if (cnt++ > 100) {      /* if we are getting infinite EOFs */
+               bye();          /* quit the game */
+               exit(1);
+       }
     if (c == CTRL(L)) {
        wrefresh(curscr);
        goto over;
     if (c == CTRL(L)) {
        wrefresh(curscr);
        goto over;
@@ -557,6 +572,12 @@ getline()
     return linebuf;
 }
 
     return linebuf;
 }
 
+rint()
+{
+       bye();
+       exit(1);
+}
+
 /*
  * bye:
  *     Leave the program, cleaning things up as we go.
 /*
  * bye:
  *     Leave the program, cleaning things up as we go.
@@ -568,5 +589,4 @@ bye()
        fflush(stdout);
        endwin();
        putchar('\n');
        fflush(stdout);
        endwin();
        putchar('\n');
-       exit(1);
 }
 }