From 571a21eff8e0c2f7143a411aa7f60339b3e92b7f Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Thu, 10 Jul 2003 11:47:28 +0000 Subject: [PATCH] ResolvePath() in DerefRedir() to fix path problems on non-Win platforms --- stepmania/src/RageUtil.cpp | 11 +++++++++-- stepmania/src/RageUtil_FileDB.cpp | 2 ++ stepmania/src/RageUtil_FileDB.h | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/stepmania/src/RageUtil.cpp b/stepmania/src/RageUtil.cpp index ee3e9867fe..8f50533800 100644 --- a/stepmania/src/RageUtil.cpp +++ b/stepmania/src/RageUtil.cpp @@ -472,7 +472,12 @@ CString DerefRedir(const CString &path) CString sDir, sFName, sExt; splitrelpath( path, sDir, sFName, sExt ); - if(sExt != "redir") return path; + if(sExt != "redir") + { + CString path2 = path; + ResolvePath( path2 ); + return path2; + } CString sNewFileName; { @@ -486,7 +491,9 @@ CString DerefRedir(const CString &path) if(sNewFileName == "") return ""; - return sDir+sNewFileName; + CString path2 = sDir+sNewFileName; + ResolvePath( path2 ); + return path2; } CString GetRedirContents(const CString &path) diff --git a/stepmania/src/RageUtil_FileDB.cpp b/stepmania/src/RageUtil_FileDB.cpp index 3086aab7a5..4029a6c573 100644 --- a/stepmania/src/RageUtil_FileDB.cpp +++ b/stepmania/src/RageUtil_FileDB.cpp @@ -416,6 +416,8 @@ void GetDirListing( CString sPath, CStringArray &AddTo, bool bOnlyDirs, bool bRe } } +bool ResolvePath(CString &path) { return FDB.ResolvePath(path); } + #if 0 bool DoesFileExist( const CString &sPath ) { return FDB.DoesFileExist(sPath); } diff --git a/stepmania/src/RageUtil_FileDB.h b/stepmania/src/RageUtil_FileDB.h index 4e14eedd51..538c1558b3 100644 --- a/stepmania/src/RageUtil_FileDB.h +++ b/stepmania/src/RageUtil_FileDB.h @@ -4,6 +4,7 @@ bool DoesFileExist( const CString &sPath ); bool IsAFile( const CString &sPath ); bool IsADirectory( const CString &sPath ); +bool ResolvePath(CString &path); unsigned GetFileSizeInBytes( const CString &sFilePath ); bool DoStat(CString sPath, struct stat *st);