diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2021-08-12 22:53:30 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2021-08-12 22:53:30 +0900 |
| commit | e088857a2c195ec20b1ca47f2dd3247440499b8b (patch) | |
| tree | 2879cfc7a6dc6fa6230ca6a5ccadf1a94b2afc0b | |
| parent | 9f2f78b96abb538b0709d5bc5022d8dbb5c50353 (diff) | |
Replace the deprecated std::ptr_fun with std::function
| -rw-r--r-- | src/bittorrent_helper.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/bittorrent_helper.cc b/src/bittorrent_helper.cc index c0b1f60b..d3df0b4b 100644 --- a/src/bittorrent_helper.cc +++ b/src/bittorrent_helper.cc @@ -270,16 +270,18 @@ void extractFileEntries(const std::shared_ptr<DownloadContext>& ctx, error_code::BITTORRENT_PARSE_ERROR); } } - std::string utf8Path = strjoin(pathelem.begin(), pathelem.end(), "/", - std::ptr_fun(util::encodeNonUtf8)); + std::string utf8Path = strjoin( + pathelem.begin(), pathelem.end(), "/", + std::function<std::string(const std::string&)>(util::encodeNonUtf8)); if (util::detectDirTraversal(utf8Path)) { throw DL_ABORT_EX2(fmt(MSG_DIR_TRAVERSAL_DETECTED, utf8Path.c_str()), error_code::BITTORRENT_PARSE_ERROR); } std::string pePath = strjoin(pathelem.begin(), pathelem.end(), "/", - std::ptr_fun(static_cast<std::string (*)(const std::string&)>( - util::percentEncode))); + std::function<std::string(const std::string&)>( + static_cast<std::string (*)(const std::string&)>( + util::percentEncode))); std::vector<std::string> uris; createUri(urlList.begin(), urlList.end(), std::back_inserter(uris), pePath); |
