Skip to content

Commit

Permalink
Fix logic error in FileUtilities::ValidateDirectoryWritePermission
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Jackson <[email protected]>
  • Loading branch information
imikejackson committed Apr 12, 2024
1 parent 634713a commit d0ccf32
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/simplnx/Utilities/FileUtilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,10 @@ Result<> ValidateDirectoryWritePermission(const fs::path& path, bool isFile)
}

auto checkedPath = path;
if(isFile)
auto parentPath = checkedPath.parent_path();
if(isFile && !parentPath.empty())
{
checkedPath = checkedPath.parent_path();
checkedPath = parentPath;
}
// We now have the parent directory. Let us see if *any* part of the path exists

Expand Down

0 comments on commit d0ccf32

Please sign in to comment.