Skip to content

Commit

Permalink
linux: refactor some delimiter repaces
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleivg committed Nov 6, 2018
1 parent 1c77f0b commit 9cbcdb2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 16 deletions.
6 changes: 1 addition & 5 deletions src/xrCore/LocatorAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,11 +434,7 @@ void CLocatorAPI::LoadArchive(archive& A, pcstr entrypoint)

strconcat(sizeof full, full, fs_entry_point, name);
#if defined(LINUX)
char *tmp_ptr = strchr(full, '\\');
while (tmp_ptr) {
*tmp_ptr = '/';
tmp_ptr = strchr(tmp_ptr, '\\');
}
while (char* sep = strchr(full, '\\')) *sep = '/';
#endif
Register(full, A.vfs_idx, crc, ptr, size_real, size_compr, 0);
}
Expand Down
6 changes: 1 addition & 5 deletions src/xrCore/LocatorAPI_defs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,7 @@ FS_Path::FS_Path(LPCSTR _Root, LPCSTR _Add, LPCSTR _DefExt, LPCSTR _FilterCaptio
if (_Add)
xr_strcat(temp, _Add);
#if defined(LINUX)
char *ptr = strchr(temp, '\\');
while (ptr) {
*ptr = _DELIMITER;
ptr = strchr(ptr, '\\');
}
while (char* sep = strchr(temp, '\\')) *sep = '/';
#endif
if (temp[0] && temp[xr_strlen(temp) - 1] != _DELIMITER)
xr_strcat(temp, DELIMITER);
Expand Down
7 changes: 1 addition & 6 deletions src/xrEngine/GameFont.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,7 @@ void CGameFont::Initialize(pcstr cShader, pcstr cTextureName)
xr_strcpy(cTexture, sizeof(cTexture), cTextureName);

#if defined(LINUX)
char* ptr = strchr(cTexture, '\\');
while (ptr)
{
*ptr = '/';
ptr = strchr(ptr, '\\');
}
while (char* sep = strchr(cTexture, '\\')) *sep = '/';
#endif

uFlags &= ~fsValid;
Expand Down

0 comments on commit 9cbcdb2

Please sign in to comment.