diff --git a/src/c4group/C4Language.cpp b/src/c4group/C4Language.cpp index a45c254ff..1cf9aa8ee 100644 --- a/src/c4group/C4Language.cpp +++ b/src/c4group/C4Language.cpp @@ -31,6 +31,17 @@ #include "config/C4Config.h" #include "game/C4Game.h" +template +static bool GetRelativePath(const char *strPath, const char *strRelativeTo, char(&strBuffer)[iBufferSize]) +{ + // Specified path is relative to base path + // Copy relative section + const char *szCpy; + SCopy(szCpy = GetRelativePathS(strPath, strRelativeTo), strBuffer, iBufferSize); + // return whether it was made relative + return szCpy != strPath; +} + C4Language Languages; C4Language::C4Language() diff --git a/src/platform/StdFile.cpp b/src/platform/StdFile.cpp index 97f428cd5..9f338c409 100644 --- a/src/platform/StdFile.cpp +++ b/src/platform/StdFile.cpp @@ -218,16 +218,6 @@ bool GetParentPath(const char *szFilename, StdStrBuf *outBuf) return true; } -bool GetRelativePath(const char *strPath, const char *strRelativeTo, char *strBuffer, int iBufferSize) -{ - // Specified path is relative to base path - // Copy relative section - const char *szCpy; - SCopy(szCpy=GetRelativePathS(strPath, strRelativeTo), strBuffer, iBufferSize); - // return whether it was made relative - return szCpy!=strPath; -} - const char *GetRelativePathS(const char *strPath, const char *strRelativeTo) { // Specified path is relative to base path diff --git a/src/platform/StdFile.h b/src/platform/StdFile.h index 41d9a2d83..a54095b23 100644 --- a/src/platform/StdFile.h +++ b/src/platform/StdFile.h @@ -54,7 +54,6 @@ bool TruncatePath(char *szPath); // szBuffer has to be of at least _MAX_PATH length. bool GetParentPath(const char *szFilename, char *szBuffer); bool GetParentPath(const char *szFilename, StdStrBuf *outBuf); -bool GetRelativePath(const char *strPath, const char *strRelativeTo, char *strBuffer, int iBufferSize=_MAX_PATH); const char *GetRelativePathS(const char *strPath, const char *strRelativeTo); bool IsGlobalPath(const char *szPath);