void
DisplayHelp (char *name)
{
- char buf[MSG_SIZ], *manFile = MANDIR "/man6/xboard.6";
+ char buf[MSG_SIZ];
FILE *f;
- if(currentCps) snprintf(manFile = buf, MSG_SIZ, "/usr/share/man/man6/%s.6", currentCps->program);
- f = fopen(manFile, "r");
+ if(currentCps) snprintf(buf, MSG_SIZ, "/usr/local/share/man/man6/%s.6", currentCps->program);
+ else snprintf(buf, MSG_SIZ, "%s/man6/xboard.6", MANDIR);
+ f = fopen(buf, "r");
if(!f && currentCps) { // engine manual could be in two places
- snprintf(buf, MSG_SIZ, "/usr/man/man6/%s.6", currentCps->program);
+ snprintf(buf, MSG_SIZ, "/usr/share/man/man6/%s.6", currentCps->program);
f= fopen(buf, "r");
}
if(f) {
// redefine some defaults
# undef ICS_LOGON
# undef DATADIR
+# undef MANDIR
# undef LOCALEDIR
# undef SETTINGS_FILE
# define ICS_LOGON "Library/Preferences/XboardICS.conf"
# define DATADIR dataDir
+# define MANDIR manDir
# define LOCALEDIR localeDir
# define SETTINGS_FILE masterSettings
# define SYNC_MENUBAR gtkosx_application_sync_menubar(theApp)
char dataDir[MSG_SIZ]; // for expanding ~~
+ char manDir[MSG_SIZ];
char localeDir[MSG_SIZ];
char masterSettings[MSG_SIZ];
#else
theApp = g_object_new(GTKOSX_TYPE_APPLICATION, NULL);
snprintf(masterSettings, MSG_SIZ, "%s/Contents/Resources/etc/xboard.conf", path);
snprintf(dataDir, MSG_SIZ, "%s/Contents/Resources/share/xboard", path);
+ snprintf(manDir, MSG_SIZ, "%s/Contents/Resources/share/man", path);
snprintf(svgDir, MSG_SIZ, "%s/themes/default", dataDir);
g_signal_connect(theApp, "NSApplicationOpenFile", G_CALLBACK(StartNewXBoard), NULL);
g_signal_connect(theApp, "NSApplicationWillTerminate", G_CALLBACK(ExitEvent), NULL);