[Base] Remove MAX_PATH limit from to_absolute_path
Let _wfullpath allocate memory by itself to remove the limit
This commit is contained in:
parent
74c95c64d2
commit
6f2c39d8d1
|
@ -155,9 +155,13 @@ std::string::size_type find_first_of_case(const std::string& target,
|
||||||
|
|
||||||
std::wstring to_absolute_path(const std::wstring& path) {
|
std::wstring to_absolute_path(const std::wstring& path) {
|
||||||
#if XE_PLATFORM_WIN32
|
#if XE_PLATFORM_WIN32
|
||||||
wchar_t buffer[kMaxPath];
|
std::wstring result;
|
||||||
_wfullpath(buffer, path.c_str(), sizeof(buffer) / sizeof(wchar_t));
|
wchar_t* buffer = _wfullpath(nullptr, path.c_str(), 0);
|
||||||
return buffer;
|
if (buffer != nullptr) {
|
||||||
|
result.assign(buffer);
|
||||||
|
free(buffer);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
#else
|
#else
|
||||||
char buffer[kMaxPath];
|
char buffer[kMaxPath];
|
||||||
realpath(xe::to_string(path).c_str(), buffer);
|
realpath(xe::to_string(path).c_str(), buffer);
|
||||||
|
|
Loading…
Reference in New Issue