Skip to content

Commit fd3a9aa

Browse files
authored
Fix for openscad#5405 difference between boost and std library treatment of empty path in filesystem::absolute (openscad#5407)
1 parent 5dd397d commit fd3a9aa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/core/parser.y

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -760,11 +760,11 @@ bool parse(SourceFile *&file, const std::string& text, const std::string &filena
760760
{
761761
fs::path filepath;
762762
try {
763-
filepath = fs::absolute(fs::path(filename));
764-
mainFilePath = fs::absolute(fs::path(mainFile));
763+
filepath = filename.empty() ? fs::current_path() : fs::absolute(fs::path{filename});
764+
mainFilePath = mainFile.empty() ? fs::current_path() : fs::absolute(fs::path{mainFile});
765765
} catch (...) {
766766
// yyerror tries to print the file path, which throws again, and we can't do that
767-
LOG(message_group::Error, "Parser error: file access denied");
767+
LOG(message_group::Error, "Parser error: file access denied");
768768
return false;
769769
}
770770

0 commit comments

Comments
 (0)