10000 Use std::filesystem::weakly_canonical() to avoid filesyste_error by t-sin · Pull Request #62 · mimium-org/mimium · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Dec 22, 2024. It is now read-only.

Use std::filesystem::weakly_canonical() to avoid filesyste_error #62

Merged
merged 1 commit into from
Mar 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/basic/filereader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ std::pair<fs::path, FileType> getFilePath(std::string_view val) {

FileReader::FileReader(fs::path cwd) : cwd(std::move(cwd)) {}
Source FileReader::loadFile(std::string const& path) {
auto [srcpath, type] = getFilePath(fs::canonical(fs::relative(path, cwd)).string());
auto [srcpath, type] = getFilePath(fs::weakly_canonical(fs::relative(path, cwd)).string());
Source res{fs::absolute(srcpath), type, ""};
// memo: fs::exists(path,ec) for .mmm file returns file type of "unknown", not "regular" or
// "none". to prevent error, need to check specifically not to be "not found"
Expand Down
0