mirror of
https://github.com/switchbrew/libnx.git
synced 2025-07-05 02:52:13 +02:00
adjust fsdev_fixpath for cwd changes
This commit is contained in:
parent
eb93b232ef
commit
b748f14bc9
@ -199,6 +199,13 @@ fsdev_fixpath(struct _reent *r,
|
||||
strncpy(__fixedpath, path, PATH_MAX);
|
||||
else
|
||||
{
|
||||
size_t __cwd_len = strlen(__cwd);
|
||||
|
||||
if (__cwd[__cwd_len-1] != '/' && __cwd_len < PATH_MAX)
|
||||
{
|
||||
__cwd[__cwd_len] = '/';
|
||||
}
|
||||
|
||||
strncpy(__fixedpath, __cwd, PATH_MAX);
|
||||
__fixedpath[PATH_MAX] = '\0';
|
||||
strncat(__fixedpath, path, PATH_MAX - strlen(__cwd));
|
||||
|
Loading…
Reference in New Issue
Block a user