Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions filesystem/basefilesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4109,20 +4109,17 @@ bool CBaseFileSystem::FixUpPath( const char *pFileName, char *pFixedUpFileName,
}
else
{
// Get the BASE_PATH, skip past - if necessary, and lowercase the rest
// Not just yet...
char pBaseDir[MAX_PATH];

// Need to get "BASE_PATH" from the filesystem paths, and then check this name against it.
//
const int iBaseLength = GetSearchPath_safe( "BASE_PATH", true, pBaseDir );
if ( iBaseLength )
if ( m_iBaseLength < 3 ) // If It's below 3 it's most likely empty. So we try again. (GetSearchPath never returns 0?)
m_iBaseLength = GetSearchPath( "BASE_PATH", true, m_pBaseDir, sizeof( m_pBaseDir ) );

if ( m_iBaseLength > 3 )
{
// If the first part of the pFixedUpFilename is pBaseDir
// then lowercase the part after that.
if ( *pBaseDir && (iBaseLength+1 < V_strlen( pFixedUpFileName ) ) && (0 != V_strncmp( pBaseDir, pFixedUpFileName, iBaseLength ) ) )
if ( *m_pBaseDir && (m_iBaseLength+1 < V_strlen( pFixedUpFileName ) ) && (0 != V_strncmp( m_pBaseDir, pFixedUpFileName, m_iBaseLength ) ) )
{
V_strlower( &pFixedUpFileName[iBaseLength-1] );
V_strlower( &pFixedUpFileName[m_iBaseLength-1] );
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions filesystem/basefilesystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,9 @@ abstract_class CBaseFileSystem : public CTier1AppSystem< IFileSystem >
/// Remove a custom fetch job from the list (and release our reference)
friend class CFileAsyncReadJob;
void RemoveAsyncCustomFetchJob( CFileAsyncReadJob *pJob );

char m_pBaseDir[MAX_PATH];
int m_iBaseLength;
};

inline const CUtlSymbol& CBaseFileSystem::CPathIDInfo::GetPathID() const
Expand Down
Loading