Skip to content

Commit

Permalink
fix windows
Browse files Browse the repository at this point in the history
  • Loading branch information
SterlingT3485 committed Nov 20, 2024
1 parent dab9e8c commit e488e21
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/common/file_system/local_file_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,10 @@ void LocalFileSystem::createDir(const std::string& dir) const {
bool isSubdirectory(const std::filesystem::path& base, const std::filesystem::path& sub) {
try {
// Resolve paths to their canonical form
std::string canonicalBase = std::filesystem::canonical(base).string();
std::string canonicalSub = std::filesystem::canonical(sub).string();
auto canonicalBase = std::filesystem::canonical(base);
auto canonicalSub = std::filesystem::canonical(sub);


std::string relative = std::filesystem::relative(canonicalSub, canonicalBase);
std::string relative = std::filesystem::relative(canonicalSub, canonicalBase).string();
// Size check for a "." result.
// If the path starts with "..", it's not a subdirectory.
return !relative.empty() && !(relative.starts_with(".."));
Expand Down

0 comments on commit e488e21

Please sign in to comment.