Skip to content

Commit

Permalink
Canonicalize input paths in source rewriter (#479)
Browse files Browse the repository at this point in the history
  • Loading branch information
randomPoison authored Dec 16, 2024
1 parent ba72a6c commit e7efee3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tools/rewriter/SourceRewriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,13 @@ struct DirectoryParser : public llvm::cl::parser<std::string> {
llvm::errs() << "error: directory does not exist: " << dir << "\n";
return true; // true on error
}
auto ec = llvm::sys::fs::make_absolute(dir);
llvm::SmallString<PATH_MAX> real_path;
auto ec = llvm::sys::fs::real_path(dir, real_path);
if (ec) {
llvm::errs() << ec.message() << '\n';
return true;
}
Value = std::string(dir);
Value = std::string(real_path);
return false;
}
};
Expand Down

0 comments on commit e7efee3

Please sign in to comment.