예제 #1
0
/*
=======================================================================================================================================
Sys_DefaultHomePath

Get current home path.
Returns path to ET: Legacy directory.
=======================================================================================================================================
*/
char *Sys_DefaultHomePath(void) {
	char *p;

	if (!*homePath) {
		if ((p = getenv("HOME")) != NULL) {
			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;
}
예제 #2
0
파일: sys_unix.c 프로젝트: scenna/etlegacy
/**
 * @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;
}