temporary kluge fix for setting script in .tiprc file
[unix-history] / usr / src / usr.bin / tip / tip.c
index 973280b..5f95728 100644 (file)
@@ -1,4 +1,4 @@
-/*     tip.c   4.1     81/05/09        */
+/*     tip.c   4.3     81/05/18        */
 /*
  * tip - Unix link to other systems
  *  tip [-v] [-speed] system-name
 /*
  * tip - Unix link to other systems
  *  tip [-v] [-speed] system-name
@@ -91,6 +91,7 @@ char *argv[];
                printf("link down\n");
                exit(3);
        }
                printf("link down\n");
                exit(3);
        }
+       setbuf(stdout, NULL);
        loginit();
        /*
         * Now that we have the logfile and the ACU open
        loginit();
        /*
         * Now that we have the logfile and the ACU open
@@ -235,6 +236,18 @@ tipin()
 {
        char gch, bol = 1;
 
 {
        char gch, bol = 1;
 
+       /*
+        * Kinda klugey here...
+        *   check for scripting being turned on from the .tiprc file,
+        *   but be careful about just using setscript(), as we may
+        *   send a SIGEMT before tipout has a chance to set up catching
+        *   it; so wait a second, then setscript()
+        */
+       if (boolean(value(SCRIPT))) {
+               sleep(1);
+               setscript();
+       }
+
        while (1) {
                gch = getchar()&0177;
                if ((gch == character(value(ESCAPE))) && bol) {
        while (1) {
                gch = getchar()&0177;
                if ((gch == character(value(ESCAPE))) && bol) {