mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
refactor: Block unsafe fs::path std::string conversion calls
There is no change in behavior. This just helps prepare for the transition from boost::filesystem to std::filesystem by avoiding calls to methods which will be unsafe after the transaction to std::filesystem to due lack of a boost::filesystem::path::imbue equivalent and inability to set a predictable locale. Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Co-authored-by: Kiminuo <kiminuo@protonmail.com> Co-authored-by: MarcoFalke <falke.marco@gmail.com>
This commit is contained in:
@@ -32,11 +32,7 @@ InitWalletDirTestingSetup::InitWalletDirTestingSetup(const std::string& chainNam
|
||||
fs::create_directories(m_walletdir_path_cases["default"]);
|
||||
fs::create_directories(m_walletdir_path_cases["custom"]);
|
||||
fs::create_directories(m_walletdir_path_cases["relative"]);
|
||||
#if BOOST_VERSION >= 107700
|
||||
std::ofstream f(BOOST_FILESYSTEM_C_STR(m_walletdir_path_cases["file"]));
|
||||
#else
|
||||
std::ofstream f(m_walletdir_path_cases["file"].BOOST_FILESYSTEM_C_STR);
|
||||
#endif // BOOST_VERSION >= 107700
|
||||
fs::ofstream f(m_walletdir_path_cases["file"]);
|
||||
f.close();
|
||||
}
|
||||
|
||||
@@ -50,5 +46,5 @@ InitWalletDirTestingSetup::~InitWalletDirTestingSetup()
|
||||
|
||||
void InitWalletDirTestingSetup::SetWalletDir(const fs::path& walletdir_path)
|
||||
{
|
||||
gArgs.ForceSetArg("-walletdir", walletdir_path.string());
|
||||
gArgs.ForceSetArg("-walletdir", fs::PathToString(walletdir_path));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user