mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-03-12 08:55:28 +00:00
Use _fullpath
function on windows to get absolute path of a directory (#2377)
There is no standard `realpath` function in the C/C++ standard libraries for Windows, use `_fullpath` function instead to get absolute path of a directory.
This commit is contained in:
parent
662e38e9b0
commit
a9d008f942
|
@ -2895,7 +2895,11 @@ wasm_runtime_init_wasi(WASMModuleInstanceCommon *module_inst,
|
|||
|
||||
wasm_fd = 3;
|
||||
for (i = 0; i < dir_count; i++, wasm_fd++) {
|
||||
#ifdef BH_PLATFORM_WINDOWS
|
||||
path = _fullpath(resolved_path, dir_list[i], PATH_MAX);
|
||||
#else
|
||||
path = realpath(dir_list[i], resolved_path);
|
||||
#endif
|
||||
if (!path) {
|
||||
if (error_buf)
|
||||
snprintf(error_buf, error_buf_size,
|
||||
|
|
Loading…
Reference in New Issue
Block a user