diff --git a/platform/config.c b/platform/config.c index 139cced..482f017 100644 --- a/platform/config.c +++ b/platform/config.c @@ -352,6 +352,8 @@ void vfs_config_load(struct vfs_config *cfg, const wchar_t *filename) cfg->redirections_to[i], _countof(cfg->redirections_to[i]), filename); + + cfg->redirections_from_len[i] = (int)wcslen(cfg->redirections_from[i]); } } diff --git a/platform/vfs.c b/platform/vfs.c index f55fcfc..ff639f6 100644 --- a/platform/vfs.c +++ b/platform/vfs.c @@ -571,7 +571,7 @@ static HRESULT vfs_custom_path_hook( return S_FALSE; } - if (path_compare_w(src, from, wcslen(from)) != 0) { + if (path_compare_w(src, from, vfs_config.redirections_from_len[i]) != 0) { continue; } diff --git a/platform/vfs.h b/platform/vfs.h index e5e53cf..7502053 100644 --- a/platform/vfs.h +++ b/platform/vfs.h @@ -13,6 +13,7 @@ struct vfs_config { wchar_t appdata[MAX_PATH]; wchar_t option[MAX_PATH]; wchar_t redirections_from[MAX_REDIRECTIONS][MAX_PATH]; + int redirections_from_len[MAX_REDIRECTIONS]; wchar_t redirections_to[MAX_REDIRECTIONS][MAX_PATH]; };