projects
/
u
/
mdw
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Turn #ifdef LOG into a command-line option for debugging use
[u/mdw/putty]
/
terminal.c
diff --git
a/terminal.c
b/terminal.c
index
444f243
..
01fe663
100644
(file)
--- a/
terminal.c
+++ b/
terminal.c
@@
-578,13
+578,15
@@
void term_out(void) {
int c;
while ( (c = inbuf_getc()) != -1) {
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;
static FILE *fp = NULL;
- if (!fp) fp = fopen(
"putty.log"
, "wb");
+ if (!fp) fp = fopen(
logfile
, "wb");
if (fp) fputc (c, fp);
}
if (fp) fputc (c, fp);
}
-#endif
if( termstate < DO_CTRLS && (c&0x60) == 0 ) {
switch (c) {
case '\005': /* terminal type query */
if( termstate < DO_CTRLS && (c&0x60) == 0 ) {
switch (c) {
case '\005': /* terminal type query */