mirror of
https://git.mirrors.martin98.com/https://github.com/gulrak/filesystem
synced 2025-06-04 11:13:58 +08:00
Removed unwanted generation of temp strings.
This commit is contained in:
parent
cd68567543
commit
b3d9a50bb5
@ -1895,9 +1895,9 @@ GHC_INLINE void create_symlink(const path& target_name, const path& new_symlink,
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
if (api_call) {
|
||||
if (api_call(detail::fromUtf8<std::wstring>(new_symlink.u8string()).c_str(), detail::fromUtf8<std::wstring>(target_name.u8string()).c_str(), to_directory ? 1 : 0) == 0) {
|
||||
if (api_call(GHC_NATIVEWP(new_symlink), GHC_NATIVEWP(target_name), to_directory ? 1 : 0) == 0) {
|
||||
auto result = ::GetLastError();
|
||||
if (result == ERROR_PRIVILEGE_NOT_HELD && api_call(detail::fromUtf8<std::wstring>(new_symlink.u8string()).c_str(), detail::fromUtf8<std::wstring>(target_name.u8string()).c_str(), to_directory ? 3 : 2) != 0) {
|
||||
if (result == ERROR_PRIVILEGE_NOT_HELD && api_call(GHC_NATIVEWP(new_symlink), GHC_NATIVEWP(target_name), to_directory ? 3 : 2) != 0) {
|
||||
return;
|
||||
}
|
||||
ec = detail::make_system_error(result);
|
||||
|
Loading…
x
Reference in New Issue
Block a user