Ooh. Actually, that vulnerability is further-reaching than I
[sgt/putty] / terminal.c
index 81603e5..c1fef2a 100644 (file)
@@ -212,7 +212,7 @@ void term_update(void) {
     ctx = get_ctx();
     if (ctx) {
         if ( (seen_key_event && (cfg.scroll_on_key)) ||
-            (seen_disp_event && (!cfg.scroll_on_key)) ) {
+            (seen_disp_event && (cfg.scroll_on_disp)) ) {
            disptop = scrtop;
            seen_disp_event = seen_key_event = 0;
            update_sbar();
@@ -2188,3 +2188,14 @@ void term_deselect (void) {
     deselect();
     term_update();
 }
+
+/*
+ * from_backend(), to get data from the backend for the terminal.
+ */
+void from_backend(int is_stderr, char *data, int len) {
+    while (len--) {
+       if (inbuf_head >= INBUF_SIZE)
+           term_out();
+       inbuf[inbuf_head++] = *data++;
+    }
+}