Skip to content

Commit

Permalink
Fix for openscad#5405 difference between boost and std library treatm…
Browse files Browse the repository at this point in the history
…ent of empty path in filesystem::absolute (openscad#5407)
  • Loading branch information
thehans authored Nov 3, 2024
1 parent 5dd397d commit fd3a9aa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/parser.y
Original file line number Diff line number Diff line change
Expand Up @@ -760,11 +760,11 @@ bool parse(SourceFile *&file, const std::string& text, const std::string &filena
{
fs::path filepath;
try {
filepath = fs::absolute(fs::path(filename));
mainFilePath = fs::absolute(fs::path(mainFile));
filepath = filename.empty() ? fs::current_path() : fs::absolute(fs::path{filename});
mainFilePath = mainFile.empty() ? fs::current_path() : fs::absolute(fs::path{mainFile});
} catch (...) {
// yyerror tries to print the file path, which throws again, and we can't do that
LOG(message_group::Error, "Parser error: file access denied");
LOG(message_group::Error, "Parser error: file access denied");
return false;
}

Expand Down

0 comments on commit fd3a9aa

Please sign in to comment.