Switching on debug mode during the session did not create the requested
debug file.
DebugProc ()
{
appData.debugMode = !appData.debugMode;
+ if(!strcmp(appData.nameOfDebugFile, "stderr")) return; // stderr is already open, and should never be closed
+ if(!appData.debugMode) fclose(debugFP);
+ else {
+ debugFP = fopen(appData.nameOfDebugFile, "w");
+ if(debugFP == NULL) debugFP = stderr;
+ else setbuf(debugFP, NULL);
+ }
}
void