aboutsummaryrefslogtreecommitdiff
path: root/src/Cache.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Cache.cpp')
-rw-r--r--src/Cache.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Cache.cpp b/src/Cache.cpp
index 82f31b9..bb87857 100644
--- a/src/Cache.cpp
+++ b/src/Cache.cpp
@@ -3,6 +3,7 @@
#include "../include/dchat/FileUtil.hpp"
#include "../include/dchat/Gif.hpp"
#include "../include/dchat/Storage.hpp"
+#include "../include/dchat/Process.hpp"
#include <boost/filesystem/convenience.hpp>
#include <process.hpp>
#include <odhtdb/Hash.hpp>
@@ -351,8 +352,8 @@ namespace dchat
string downloadLimitBytesStr = to_string(downloadLimitBytes);
std::string cmdUtf8 = "curl -L --silent -o '";
- cmdUtf8 += filepath.string();
- cmdUtf8 += "' --max-filesize " + downloadLimitBytesStr + " --range 0-" + downloadLimitBytesStr + " --url '" + url + "'";
+ cmdUtf8 += escapeCommand(filepath.string());
+ cmdUtf8 += "' --max-filesize " + downloadLimitBytesStr + " --range 0-" + downloadLimitBytesStr + " --url '" + escapeCommand(url) + "'";
Process::string_type cmd = toNativeString(cmdUtf8);
// TODO: Use this instead of curl on windows: certutil.exe -urlcache -split -f "https://url/to/file" path/and/name/to/save/as/file
Process *process = new Process(cmd, toNativeString(""), nullptr, nullptr, false);