Skip to content

Commit

Permalink
Use realpath for mutant location
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexDenisov authored and AlexDenisov committed Jun 2, 2023
1 parent 62a4b40 commit 7b84a80
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/Path.cpp
@@ -1,10 +1,16 @@
#include "mull/Path.h"

#include <llvm/Support/Path.h>
#include <llvm/Support/FileSystem.h>

std::string mull::absoluteFilePath(const std::string &directory, const std::string &filePath) {
auto path = filePath;
if (!filePath.empty() && !llvm::sys::path::is_absolute(filePath)) {
return directory + llvm::sys::path::get_separator().str() + filePath;
path = directory + llvm::sys::path::get_separator().str() + filePath;
}
return filePath;
llvm::SmallString<PATH_MAX> realPath;
if (!llvm::sys::fs::real_path(path, realPath, true)) {
return realPath.str().str();
}
return path;
}

0 comments on commit 7b84a80

Please sign in to comment.