Skip to content

Commit

Permalink
Work around VS2019 filesystem issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jbytheway committed Mar 14, 2023
1 parent 4be58c1 commit 6df786b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/filesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) );
}

Expand Down

0 comments on commit 6df786b

Please sign in to comment.