X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/9fab77dc00ff2183dd642f4f088d2d54ed3d5887..e93ed4323c03b94653cda6ba5881c0081c3d905f:/unix/uxmisc.c diff --git a/unix/uxmisc.c b/unix/uxmisc.c index 8239158e..6889bcaf 100644 --- a/unix/uxmisc.c +++ b/unix/uxmisc.c @@ -3,6 +3,7 @@ */ #include +#include #include #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