Skip to content

Commit ac02cd1

Browse files
committed
xrCore/Xr_ini: Now uses EFS_Utils abstraction.
1 parent 8880327 commit ac02cd1

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/xrCore/Xr_ini.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#include "stdafx.h"
22
#pragma hdrstop
33

4+
#include "FileSystem.h"
5+
46
XRCORE_API CInifile const* pSettings = NULL;
57
XRCORE_API CInifile const* pSettingsAuth = NULL;
68

@@ -134,15 +136,13 @@ CInifile::CInifile(LPCSTR szFileName,
134136

135137
if (bLoad)
136138
{
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);
140140
IReader* R = FS.r_open(szFileName);
141141
if (R)
142142
{
143143
if (sect_count)
144144
DATA.reserve(sect_count);
145-
Load(R, path
145+
Load(R, path.c_str()
146146
#ifndef _EDITOR
147147
, allow_include_func
148148
#endif
@@ -250,17 +250,16 @@ void CInifile::Load(IReader* F, LPCSTR path
250250
R_ASSERT(path&&path[0]);
251251
if (_GetItem(str, 1, inc_name, '"'))
252252
{
253-
string_path fn, inc_path, folder;
253+
string_path fn;
254254
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);
257256
#ifndef _EDITOR
258257
if (!allow_include_func || allow_include_func(fn))
259258
#endif
260259
{
261260
IReader* I = FS.r_open(fn);
262261
R_ASSERT3(I, "Can't find include file:", inc_name);
263-
Load(I, inc_path
262+
Load(I, inc_path.c_str()
264263
#ifndef _EDITOR
265264
, allow_include_func
266265
#endif

0 commit comments

Comments
 (0)