diff --git a/src/filesystem.cpp b/src/filesystem.cpp index e498da37363f6..429995ffa77d3 100644 --- a/src/filesystem.cpp +++ b/src/filesystem.cpp @@ -21,6 +21,15 @@ bool assure_dir_exist( const std::string &path ) { + // TEMPORARY until we drop VS2019 support + // VS2019 std::filesystem doesn't handle trailing slashes well in this + // situation. We think this is a bug. Work around it by removing the + // trailing slash if present. + if( string_ends_with( path, "/" ) ) { + std::string p = path; + p.pop_back(); + return assure_dir_exist( fs::u8path( p ) ); + } return assure_dir_exist( fs::u8path( path ) ); }