alright, purte rote_vt_update that was completely poorly designed, use a
[apps/madtty.git] / madtty / madtty.c
index 8fbc469..af959ce 100644 (file)
@@ -29,8 +29,6 @@
 #include "madtty.h"
 #include "roteprivate.h"
 
-#define ROTE_VT_UPDATE_ITERATIONS 5
-
 RoteTerm *rote_vt_create(int rows, int cols)
 {
     RoteTerm *rt;
@@ -118,9 +116,10 @@ void rote_vt_draw(RoteTerm *rt, WINDOW *win, int srow, int scol,
                   void (*cur_set_attr)(WINDOW*,unsigned char)) {
 
     int i, j;
-    rote_vt_update(rt);
 
-    if (!cur_set_attr) cur_set_attr = default_cur_set_attr;
+    if (!cur_set_attr)
+        cur_set_attr = default_cur_set_attr;
+
     for (i = 0; i < rt->rows; i++) {
         wmove(win, srow + i, scol);
         for (j = 0; j < rt->cols; j++) {
@@ -235,29 +234,6 @@ void rote_vt_forsake_child(RoteTerm *rt)
     rt->childpid = 0;
 }
 
-void rote_vt_update(RoteTerm *rt)
-{
-    char buf[512];
-    int nbread;
-    int n = ROTE_VT_UPDATE_ITERATIONS;
-
-    while (n--) { /* iterate at most ROVE_VT_UPDATE_ITERATIONS times.
-                   * As Phil Endecott pointed out, if we don't restrict this,
-                   * a program that floods the terminal with output
-                   * could cause this loop to iterate forever, never
-                   * being able to catch up. So we'll rely on the client
-                   * calling rote_vt_update often, as the documentation
-                   * recommends :-) */
-
-        nbread = rote_vt_read(rt, buf, sizeof(buf));
-        if (nbread <= 0)
-            return;
-
-        /* inject the data into the terminal */
-        rote_vt_inject(rt, buf, nbread);
-    }
-}
-
 int rote_vt_read(RoteTerm *rt, char *buf, int buflen)
 {
     if (rt->pty < 0) {