Skip to content

Commit 1bd116c

Browse files
committed
use allocating mode of ::realpath by default (nw)
1 parent f2320e4 commit 1bd116c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/osd/modules/file/posixfile.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,13 @@ osd_file::error osd_get_full_path(std::string &dst, std::string const &path)
390390
return osd_file::error::FAILURE;
391391
}
392392
#else
393+
std::unique_ptr<char, void (*)(void *)> canonical(::realpath(path.c_str(), nullptr), &std::free);
394+
if (canonical)
395+
{
396+
dst = canonical.get();
397+
return osd_file::error::NONE;
398+
}
399+
393400
std::vector<char> path_buffer(PATH_MAX);
394401
if (::realpath(path.c_str(), &path_buffer[0]))
395402
{

0 commit comments

Comments
 (0)