#define MAX_GAME_PATHS 10
char *homePath;
+qboolean homePathUsesDot;
char installPath[ MAX_OS_PATH ];
int numBasePaths;
#ifdef WIN32
#include <shlobj.h>
#endif
-char *LokiGetHomeDir( void )
+char *LokiGetHomeDir( qboolean *usedot )
{
+ *usedot = qtrue;
#ifndef Q_UNIX
#ifndef WIN32
return NULL;
if(SHGetFolderPath(NULL, CSIDL_PERSONAL, NULL, 0, mydocsdir))
{
snprintf(buf, sizeof(buf), "%s/My Games", mydocsdir);
+ *usedot = qfalse;
return buf;
}
return NULL;
}
endpwent();
}
+
+ #ifdef __APPLE__
+ {
+ static char foo[MAX_OSPATH];
+ snprintf(foo, sizeof(foo), "%s/Library/Application Support", home);
+ if(access(foo, X_OK) == 0)
+ {
+ *usedot = qfalse;
+ home = foo;
+ }
+ }
+ #endif
/* return it */
return home;
strcpy( installPath, "../" );
/* get home dir */
- home = LokiGetHomeDir();
+ home = LokiGetHomeDir(&homePathUsesDot);
if( home == NULL )
home = ".";
-
+
/* set home path */
homePath = home;
#else
/* get home dir */
- home = LokiGetHomeDir();
+ home = LokiGetHomeDir(&homePathUsesDot);
if( home == NULL )
home = ".";
return;
/* concatenate home dir and path */
- sprintf( temp, "%s/%s", homePath, path );
+ sprintf( temp, "%s/%s", homePath, homePathUsesDot ? path : (path+1) );
#ifdef WIN32
{