]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - terminal.c
Add multi-makefile management system
[PuTTY.git] / terminal.c
index ab6ffd00ff276739117cf5e1dda23415cb39b465..d07f5937fc013f00bf8b2a606b75b4e1303492b1 100644 (file)
@@ -1,4 +1,3 @@
-++ terminal.c.new      Mon Nov 22 15:02:03 1999
 #include <windows.h>
 
 #include <stdio.h>
@@ -151,7 +150,7 @@ void term_update(void) {
     Context ctx;
     ctx = get_ctx();
     if (ctx) {
-        if ( (seen_key_event && (unscroll_event & US_KEY)) &&
+        if ( (seen_key_event && (unscroll_event & US_KEY)) ||
             (seen_disp_event && (unscroll_event & US_DISP)) ) {
            disptop = scrtop;
            seen_disp_event = seen_key_event = 0;
@@ -579,13 +578,15 @@ void term_out(void) {
     int c;
 
     while ( (c = inbuf_getc()) != -1) {
-#ifdef LOG
-       {
+        /*
+         * Optionally log the session traffic to a file. Useful for
+         * debugging and possibly also useful for actual logging.
+         */
+       if (logfile) {
            static FILE *fp = NULL;
-           if (!fp) fp = fopen("putty.log", "wb");
+           if (!fp) fp = fopen(logfile, "wb");
            if (fp) fputc (c, fp);
        }
-#endif
        if( termstate < DO_CTRLS && (c&0x60) == 0 ) {
            switch (c) {
              case '\005':             /* terminal type query */