1
0
mirror of synced 2024-11-24 05:50:12 +01:00

vfs: fix blank config

This commit is contained in:
Kevin Trocolli 2024-01-09 20:48:19 -05:00
parent 6c3636167d
commit f759f2a7bf
2 changed files with 9 additions and 7 deletions

View File

@ -17,6 +17,7 @@
#include "platform/clock.h"
#include "platform/dns.h"
#include "platform/es3sec.h"
#include "util/dprintf.h"
void platform_config_load(struct platform_config *cfg, const wchar_t *filename)
{
@ -46,13 +47,19 @@ void vfs_config_load(struct vfs_config *cfg, const wchar_t *filename)
GetPrivateProfileStringW(
L"vfs",
L"path",
L"",
L"\0",
cfg->path,
_countof(cfg->path),
filename);
len = wcslen(cfg->path);
if (cfg->path[0] == L'\0') {
dprintf("No vfs folder specified, using default 'vfs' at CWD\n");
GetCurrentDirectoryW(_countof(cfg->path), cfg->path);
wcscat_s(cfg->path, _countof(cfg->path), L"vfs");
}
if (cfg->path[len - 2] != '\\' && cfg->path[len - 2] != '/') { // -2 for null terminator
StringCbCatW(cfg->path, sizeof(cfg->path), L"\\\0");
}

View File

@ -40,11 +40,6 @@ HRESULT vfs_hook_init(const struct vfs_config *config)
memcpy(&vfs_config, config, sizeof(*config));
if (config->path[0] == L'\0') {
dprintf("No vfs folder specified, using default 'vfs' at CWD\n");
wcscpy_s(vfs_config.path, _countof(config->path), L"vfs");
}
vfs_fixup_path(vfs_config.path, _countof(vfs_config.path));
vfs_fixup_path(vfs_config.d, _countof(vfs_config.d));
vfs_fixup_path(vfs_config.e, _countof(vfs_config.e));