mirror of https://github.com/aria2/aria2
Replace the deprecated std::ptr_fun with std::function
parent
9f2f78b96a
commit
e088857a2c
|
@ -270,16 +270,18 @@ void extractFileEntries(const std::shared_ptr<DownloadContext>& ctx,
|
||||||
error_code::BITTORRENT_PARSE_ERROR);
|
error_code::BITTORRENT_PARSE_ERROR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
std::string utf8Path = strjoin(pathelem.begin(), pathelem.end(), "/",
|
std::string utf8Path = strjoin(
|
||||||
std::ptr_fun(util::encodeNonUtf8));
|
pathelem.begin(), pathelem.end(), "/",
|
||||||
|
std::function<std::string(const std::string&)>(util::encodeNonUtf8));
|
||||||
if (util::detectDirTraversal(utf8Path)) {
|
if (util::detectDirTraversal(utf8Path)) {
|
||||||
throw DL_ABORT_EX2(fmt(MSG_DIR_TRAVERSAL_DETECTED, utf8Path.c_str()),
|
throw DL_ABORT_EX2(fmt(MSG_DIR_TRAVERSAL_DETECTED, utf8Path.c_str()),
|
||||||
error_code::BITTORRENT_PARSE_ERROR);
|
error_code::BITTORRENT_PARSE_ERROR);
|
||||||
}
|
}
|
||||||
std::string pePath =
|
std::string pePath =
|
||||||
strjoin(pathelem.begin(), pathelem.end(), "/",
|
strjoin(pathelem.begin(), pathelem.end(), "/",
|
||||||
std::ptr_fun(static_cast<std::string (*)(const std::string&)>(
|
std::function<std::string(const std::string&)>(
|
||||||
util::percentEncode)));
|
static_cast<std::string (*)(const std::string&)>(
|
||||||
|
util::percentEncode)));
|
||||||
std::vector<std::string> uris;
|
std::vector<std::string> uris;
|
||||||
createUri(urlList.begin(), urlList.end(), std::back_inserter(uris),
|
createUri(urlList.begin(), urlList.end(), std::back_inserter(uris),
|
||||||
pePath);
|
pePath);
|
||||||
|
|
Loading…
Reference in New Issue