Patch from James H: make the Windows debugging output conditional on

an enabling environment variable.

[originally from svn r8834]
This commit is contained in:
Simon Tatham
2010-01-12 23:32:22 +00:00
parent 7aefa1110a
commit b3af872f3c

View File

@ -154,11 +154,17 @@ void debug_printf(char *fmt, ...)
{ {
char buf[4096]; char buf[4096];
va_list ap; va_list ap;
static int debugging = -1;
va_start(ap, fmt); if (debugging == -1)
_vsnprintf(buf, 4095, fmt, ap); debugging = getenv("DEBUG_PUZZLES") ? 1 : 0;
dputs(buf);
va_end(ap); if (debugging) {
va_start(ap, fmt);
_vsnprintf(buf, 4095, fmt, ap);
dputs(buf);
va_end(ap);
}
} }
#endif #endif