diff --git a/src/Common/PlatformLinux.inl b/src/Common/PlatformLinux.inl index 7ab87c271a0..db926537ff7 100644 --- a/src/Common/PlatformLinux.inl +++ b/src/Common/PlatformLinux.inl @@ -95,14 +95,22 @@ inline void _splitpath ( char* fname, // Filename : Output char* ext // Extension : Output ){ + char *tmp = NULL; + tmp = realpath(path, NULL); + if(drive) strcpy(drive, ""); - if(dir) - strcpy(dir, dirname(path)); + if(dir) { + strcpy(dir, dirname(tmp)); + if (dir[0] && dir[strlen(dir) - 1] != '/') + strcat(dir, "/"); + } if(fname) - strcpy(fname, basename(path)); + strcpy(fname, basename(tmp)); + + free(tmp); } #include diff --git a/src/xrCore/LocatorAPI.cpp b/src/xrCore/LocatorAPI.cpp index 5bc1a0a8ac4..dd43721dcf1 100644 --- a/src/xrCore/LocatorAPI.cpp +++ b/src/xrCore/LocatorAPI.cpp @@ -193,10 +193,9 @@ const CLocatorAPI::file* CLocatorAPI::RegisterExternal(pcstr name) const CLocatorAPI::file* CLocatorAPI::Register( pcstr name, u32 vfs, u32 crc, u32 ptr, u32 size_real, u32 size_compressed, u32 modif) { - Msg("Register[%d] [%s]",vfs,name); + //Msg("Register[%d] [%s]",vfs,name); string256 temp_file_name; xr_strcpy(temp_file_name, sizeof temp_file_name, name); - xr_strlwr(temp_file_name); // Register file file desc; @@ -403,7 +402,13 @@ void CLocatorAPI::LoadArchive(archive& A, pcstr entrypoint) buffer += sizeof ptr; 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, '\\'); + } +#endif Register(full, A.vfs_idx, crc, ptr, size_real, size_compr, 0); } hdr->close(); @@ -531,7 +536,7 @@ void CLocatorAPI::ProcessOne(pcstr path, const _finddata_t& entry) return; if (0 == xr_strcmp(entry.name, "..")) return; - xr_strcat(N, "\\"); + xr_strcat(N, DELIMITER); Register(N, 0xffffffff, 0, 0, entry.size, entry.size, (u32)entry.time_write); Recurse(N); } @@ -1254,7 +1259,7 @@ void CLocatorAPI::file_from_archive(IReader*& R, pcstr fname, const file& desc) VERIFY3(ptr, "cannot create file mapping on file", fname); - string512 temp; + string1024 temp; xr_sprintf(temp, sizeof temp, "%s:%s", *A.path, fname); #ifdef FS_DEBUG @@ -1388,7 +1393,6 @@ bool CLocatorAPI::check_for_file(pcstr path, pcstr _fname, string_path& fname, c // correct path xr_strcpy(fname, _fname); - xr_strlwr(fname); if (path && path[0]) update_path(fname, path, fname); diff --git a/src/xrCore/LocatorAPI_defs.cpp b/src/xrCore/LocatorAPI_defs.cpp index 01ba43cd4ac..174fae21e5b 100644 --- a/src/xrCore/LocatorAPI_defs.cpp +++ b/src/xrCore/LocatorAPI_defs.cpp @@ -118,7 +118,7 @@ LPCSTR FS_Path::_update(string_path& dest, LPCSTR src) const string_path temp; xr_strcpy(temp, sizeof(temp), src); strconcat(sizeof(dest), dest, m_Path, temp); - return xr_strlwr(dest); + return dest; } /* void FS_Path::_update(xr_string& dest, LPCSTR src)const diff --git a/src/xrCore/xr_ini.cpp b/src/xrCore/xr_ini.cpp index d5108571d15..30c91424e0f 100644 --- a/src/xrCore/xr_ini.cpp +++ b/src/xrCore/xr_ini.cpp @@ -450,6 +450,13 @@ void CInifile::Load(IReader* F, pcstr path, allow_include_func_t allow_include_f R_ASSERT(path && path[0]); if (_GetItem(str, 1, inc_name, '"')) { +#if defined(LINUX) + char *tmp_ptr = strchr(inc_name, '\\'); + while (tmp_ptr) { + *tmp_ptr = '/'; + tmp_ptr = strchr(tmp_ptr, '\\'); + } +#endif string_path fn; strconcat(sizeof fn, fn, path, inc_name); const xr_string inc_path = EFS_Utils::ExtractFilePath(fn);