mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-04-21 21:15:03 -05:00
Windows: move dputs back into winmisc.c.
Having it in winmiscs.c made it conflict with the one in testcrypt.
This commit is contained in:
parent
ba4eeff9cb
commit
621f8f4314
@ -405,3 +405,30 @@ void unescape_registry_key(const char *in, strbuf *out)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
static FILE *debug_fp = NULL;
|
||||||
|
static HANDLE debug_hdl = INVALID_HANDLE_VALUE;
|
||||||
|
static int debug_got_console = 0;
|
||||||
|
|
||||||
|
void dputs(const char *buf)
|
||||||
|
{
|
||||||
|
DWORD dw;
|
||||||
|
|
||||||
|
if (!debug_got_console) {
|
||||||
|
if (AllocConsole()) {
|
||||||
|
debug_got_console = 1;
|
||||||
|
debug_hdl = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!debug_fp) {
|
||||||
|
debug_fp = fopen("debug.log", "w");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (debug_hdl != INVALID_HANDLE_VALUE) {
|
||||||
|
WriteFile(debug_hdl, buf, strlen(buf), &dw, NULL);
|
||||||
|
}
|
||||||
|
fputs(buf, debug_fp);
|
||||||
|
fflush(debug_fp);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
@ -16,33 +16,6 @@ void smemclr(void *b, size_t n) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
static FILE *debug_fp = NULL;
|
|
||||||
static HANDLE debug_hdl = INVALID_HANDLE_VALUE;
|
|
||||||
static int debug_got_console = 0;
|
|
||||||
|
|
||||||
void dputs(const char *buf)
|
|
||||||
{
|
|
||||||
DWORD dw;
|
|
||||||
|
|
||||||
if (!debug_got_console) {
|
|
||||||
if (AllocConsole()) {
|
|
||||||
debug_got_console = 1;
|
|
||||||
debug_hdl = GetStdHandle(STD_OUTPUT_HANDLE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!debug_fp) {
|
|
||||||
debug_fp = fopen("debug.log", "w");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (debug_hdl != INVALID_HANDLE_VALUE) {
|
|
||||||
WriteFile(debug_hdl, buf, strlen(buf), &dw, NULL);
|
|
||||||
}
|
|
||||||
fputs(buf, debug_fp);
|
|
||||||
fflush(debug_fp);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef MINEFIELD
|
#ifdef MINEFIELD
|
||||||
/*
|
/*
|
||||||
* Minefield - a Windows equivalent for Electric Fence
|
* Minefield - a Windows equivalent for Electric Fence
|
||||||
|
Loading…
x
Reference in New Issue
Block a user