X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=xboard.c;h=1e009fa8c4c96844d763ff405b77fb71db07e1ad;hb=71a0dc43ed9498db72f4a302a4b11fabb93ab286;hp=af116f02bfaa5301eef28786dd546e2366d1c778;hpb=cbef46783d8c68cb6ce106fc278edf3446b720fc;p=xboard.git diff --git a/xboard.c b/xboard.c index af116f0..1e009fa 100644 --- a/xboard.c +++ b/xboard.c @@ -1907,7 +1907,15 @@ main(argc, argv) XtGetApplicationResources(shellWidget, (XtPointer) &appData, clientResources, XtNumber(clientResources), NULL, 0); - + + if (appData.debugMode) { + if ((debugFP = fopen("xboard.debug", "w")) == NULL) { + printf(_("Failed to open file xboard.debug \n")); + exit(errno); + } + setbuf(debugFP, NULL); + } + #if !HIGHDRAG /* This feature does not work; animation needs a rewrite */ appData.highlightDragging = FALSE; @@ -2553,6 +2561,8 @@ XBoard square size (hint): %d\n\ } XtAppMainLoop(appContext); + if (appData.debugMode) fclose(debugFP); + return 0; }