|
1 | 1 | #include "stdafx.h" |
2 | 2 | #pragma hdrstop |
3 | 3 |
|
| 4 | +#include "FileSystem.h" |
| 5 | + |
4 | 6 | XRCORE_API CInifile const* pSettings = NULL; |
5 | 7 | XRCORE_API CInifile const* pSettingsAuth = NULL; |
6 | 8 |
|
@@ -134,15 +136,13 @@ CInifile::CInifile(LPCSTR szFileName, |
134 | 136 |
|
135 | 137 | if (bLoad) |
136 | 138 | { |
137 | | - string_path path, folder; |
138 | | - _splitpath(m_file_name, path, folder, 0, 0); |
139 | | - xr_strcat(path, sizeof(path), folder); |
| 139 | + const xr_string path = EFS_Utils::ExtractFilePath(m_file_name); |
140 | 140 | IReader* R = FS.r_open(szFileName); |
141 | 141 | if (R) |
142 | 142 | { |
143 | 143 | if (sect_count) |
144 | 144 | DATA.reserve(sect_count); |
145 | | - Load(R, path |
| 145 | + Load(R, path.c_str() |
146 | 146 | #ifndef _EDITOR |
147 | 147 | , allow_include_func |
148 | 148 | #endif |
@@ -250,17 +250,16 @@ void CInifile::Load(IReader* F, LPCSTR path |
250 | 250 | R_ASSERT(path&&path[0]); |
251 | 251 | if (_GetItem(str, 1, inc_name, '"')) |
252 | 252 | { |
253 | | - string_path fn, inc_path, folder; |
| 253 | + string_path fn; |
254 | 254 | strconcat(sizeof(fn), fn, path, inc_name); |
255 | | - _splitpath(fn, inc_path, folder, 0, 0); |
256 | | - xr_strcat(inc_path, sizeof(inc_path), folder); |
| 255 | + const xr_string inc_path = EFS_Utils::ExtractFilePath(fn); |
257 | 256 | #ifndef _EDITOR |
258 | 257 | if (!allow_include_func || allow_include_func(fn)) |
259 | 258 | #endif |
260 | 259 | { |
261 | 260 | IReader* I = FS.r_open(fn); |
262 | 261 | R_ASSERT3(I, "Can't find include file:", inc_name); |
263 | | - Load(I, inc_path |
| 262 | + Load(I, inc_path.c_str() |
264 | 263 | #ifndef _EDITOR |
265 | 264 | , allow_include_func |
266 | 265 | #endif |
|
0 commit comments