From 96f50dd5e600925488fdd9db1580aa01b026269b Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 6 Oct 2023 02:37:16 +0200 Subject: Use dcp::filesystem to wrap filesystem calls and fix_long_path anything that is passed to read_file() from libcxml. This should fix #2623 and other similar problems. --- src/lib/state.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/lib/state.cc') diff --git a/src/lib/state.cc b/src/lib/state.cc index e22f9e0b9..f345d119e 100644 --- a/src/lib/state.cc +++ b/src/lib/state.cc @@ -22,6 +22,7 @@ #include "cross.h" #include "state.h" #include "util.h" +#include #include @@ -60,11 +61,9 @@ config_path_or_override (optional version) boost::filesystem::path State::read_path (string file) { - using namespace boost::filesystem; - for (auto i: config_versions) { auto full = config_path_or_override(i) / file; - if (exists(full)) { + if (dcp::filesystem::exists(full)) { return full; } } @@ -79,9 +78,9 @@ State::read_path (string file) boost::filesystem::path State::write_path (string file) { - boost::filesystem::path p = config_path_or_override(config_versions.front()); + auto p = config_path_or_override(config_versions.front()); boost::system::error_code ec; - boost::filesystem::create_directories (p, ec); + dcp::filesystem::create_directories(p, ec); p /= file; return p; } -- cgit v1.2.3