Пример #1
0
void PbSvBuildBasePath(char* ospath)
{
	ospath[0] = '\0';
	char pathsep[2];

	pathsep[0] = PATH_SEP;
	pathsep[1] = '\0';

	if ( pbsv.PbSvGameQuery == NULL )
	{
		return;
	}
	
	Q_strncpyz(ospath, "fs_homepath", MAX_OSPATH);
	pbsv.PbSvGameQuery(103, ospath);

	if(ospath[0] == '\0')
	{
		Q_strncpyz(ospath, Sys_DefaultInstallPath( ), MAX_OSPATH - 5 );
	}
	
	if ( ospath[0] )
    {
		if ( ospath[strlen(ospath) -1] != PATH_SEP )
		{
			Q_strcat(ospath, MAX_OSPATH, pathsep);
		}
    }
	Q_strcat(ospath, MAX_OSPATH, "pb");
	Q_strcat(ospath, MAX_OSPATH, pathsep);
}
Пример #2
0
/**
 * @brief Get current home path
 * @return path to ET: Legacy directory
 */
char *Sys_DefaultHomePath(void)
{
	char *p;

	if (!*homePath)
	{
#if defined(__AROS__) || defined(__MORPHOS__)
		if (*(p = Sys_DefaultInstallPath()) != 0)
#else
		if ((p = getenv("HOME")) != NULL)
#endif
		{
			Q_strncpyz(homePath, p, sizeof(homePath));
#ifdef __APPLE__
			Q_strncpyz(homePath, OSX_ApplicationSupportPath(), sizeof(homePath));
			Q_strcat(homePath, sizeof(homePath), "/etlegacy");
#else
			Q_strcat(homePath, sizeof(homePath), "/.etlegacy");
#endif
		}
	}

	return homePath;
}