mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-06-30 11:02:48 -05:00
Reorganisation of misc.c: Minefield has moved out to winmisc.c, and
so has the Windows dputs() - which has also acquired a Unix counterpart in uxmisc.c. -DDEBUG should now work on Unix. [originally from svn r2914]
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#include "putty.h"
|
||||
@ -40,3 +41,19 @@ int filename_is_null(Filename fn)
|
||||
{
|
||||
return !*fn.path;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
static FILE *debug_fp = NULL;
|
||||
|
||||
void dputs(char *buf)
|
||||
{
|
||||
if (!debug_fp) {
|
||||
debug_fp = fopen("debug.log", "w");
|
||||
}
|
||||
|
||||
write(1, buf, strlen(buf));
|
||||
|
||||
fputs(buf, debug_fp);
|
||||
fflush(debug_fp);
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user