diff --git a/libopenage/util/fslike/directory.cpp b/libopenage/util/fslike/directory.cpp index 4143e376e3..617d288324 100644 --- a/libopenage/util/fslike/directory.cpp +++ b/libopenage/util/fslike/directory.cpp @@ -293,8 +293,9 @@ std::ostream &Directory::repr(std::ostream &stream) { return stream; } -Directory Directory::get_temp_directory() { - std::string temp_dir_path = std::filesystem::temp_directory_path() / std::tmpnam(nullptr); +static Directory get_temp_directory() { + std::filesystem::path path = std::filesystem::temp_directory_path() / std::tmpnam(nullptr); + std::string temp_dir_path = path.string(); bool create = true; Directory directory = Directory(temp_dir_path, create); return directory;