X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=terminal.c;h=d07f5937fc013f00bf8b2a606b75b4e1303492b1;hb=5176e1e9bbdc6620a115da0f92ca2282a6714721;hp=ab6ffd00ff276739117cf5e1dda23415cb39b465;hpb=a8d5838ebcc5d416620c196b146e5e4a252c1571;p=PuTTY.git diff --git a/terminal.c b/terminal.c index ab6ffd00..d07f5937 100644 --- a/terminal.c +++ b/terminal.c @@ -1,4 +1,3 @@ -++ terminal.c.new Mon Nov 22 15:02:03 1999 #include #include @@ -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 */