mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-22 04:52:39 +02:00
adjust fsdev_fixpath for cwd changes (#132)
* adjust fsdev_fixpath for cwd changes
This commit is contained in:
parent
d48cf6aa2e
commit
aa3c35e6e3
@ -1039,8 +1039,17 @@ fsdev_chdir(struct _reent *r,
|
|||||||
if(R_SUCCEEDED(rc))
|
if(R_SUCCEEDED(rc))
|
||||||
{
|
{
|
||||||
fsDirClose(&fd);
|
fsDirClose(&fd);
|
||||||
strncpy(__cwd, __fixedpath, PATH_MAX);
|
strncpy(__cwd, fs_path, PATH_MAX);
|
||||||
__cwd[PATH_MAX] = '\0';
|
__cwd[PATH_MAX] = '\0';
|
||||||
|
|
||||||
|
size_t __cwd_len = strlen(__cwd);
|
||||||
|
|
||||||
|
if (__cwd[__cwd_len-1] != '/' && __cwd_len < PATH_MAX)
|
||||||
|
{
|
||||||
|
__cwd[__cwd_len] = '/';
|
||||||
|
__cwd[__cwd_len+1] = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
fsdev_fsdevice_cwd = device->id;
|
fsdev_fsdevice_cwd = device->id;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user