FEXRootFSFetcher: Fixes curl downloading with spaces in the path

Since we're invoking curl directly, we don't need to wrap it in `sh -c`
with this function.

Fixes an issue where curl downloads to a non-escaped path weren't
working. Now they do.
This commit is contained in:
Ryan Houdek committed 2023-11-28 01:19:46 -08:00
1 parent bba156a3c1
commit 47d79978ef
1 file changed
+6 -10
+6 -10
View File
@@ -489,12 +489,9 @@ namespace WebFileFetcher {
const static std::string DownloadURL = "https://rootfs.fex-emu.gg/RootFS_links.json";
std::string DownloadToString(const std::string &URL) {
std::string BigArgs =
fmt::format("curl {}", URL);
std::vector<const char*> ExecveArgs = {
"/bin/sh",
"-c",
BigArgs.c_str(),
"curl",
URL.c_str(),
nullptr,
};
@@ -505,12 +502,11 @@ namespace WebFileFetcher {
auto filename = URL.substr(URL.find_last_of('/') + 1);
auto PathName = Path + filename;
std::string BigArgs =
fmt::format("curl {} -o {}", URL, PathName);
std::vector<const char*> ExecveArgs = {
"/bin/sh",
"-c",
BigArgs.c_str(),
"curl",
URL.c_str(),
"-o",
PathName.c_str(),
nullptr,
};