added amb1191 - absolute paths

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401735
This commit is contained in:
David Anderson
2007-11-27 02:19:39 +00:00
parent 4d63d44155
commit b98edf88b6
3 changed files with 51 additions and 5 deletions
+18 -3
View File
@@ -443,20 +443,35 @@ size_t SourceModBase::BuildPath(PathType type, char *buffer, size_t maxlength, c
vsnprintf(_buffer, PLATFORM_MAX_PATH, format, ap);
va_end(ap);
/* If we get a "file://" notation, strip off the file:// part so we're left
* with an absolute path. Note that the absolute path gets returned, so
* usage with relative paths here is completely invalid.
*/
if (type != Path_SM_Rel && strncmp(_buffer, "file://", 7) == 0)
{
return g_LibSys.PathFormat(buffer, maxlength, "%s", &_buffer[7]);
}
const char *base = NULL;
if (type == Path_Game)
{
base = GetGamePath();
} else if (type == Path_SM) {
}
else if (type == Path_SM)
{
base = GetSourceModPath();
} else if (type == Path_SM_Rel) {
}
else if (type == Path_SM_Rel)
{
base = m_SMRelDir;
}
if (base)
{
return g_LibSys.PathFormat(buffer, maxlength, "%s/%s", base, _buffer);
} else {
}
else
{
return g_LibSys.PathFormat(buffer, maxlength, "%s", _buffer);
}
}