mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-10 05:32:40 -05:00
[BugFix] Hosted incoming directory component leading slashes
leading slashes in directory components to path_append makes a path with a leading slash absolute and discards the basepath Change-Id: I65253080c0ca4278b559894104ab25ab199a3100
This commit is contained in:
parent
4e1faa032f
commit
d1f14c7b46
1 changed files with 2 additions and 1 deletions
|
|
@ -210,7 +210,7 @@ const char * handle_special_dirs(const char *dir, unsigned flags,
|
|||
if (!strncmp(HOME_DIR, dir, HOME_DIR_LEN))
|
||||
{
|
||||
const char *p = dir + HOME_DIR_LEN;
|
||||
while (*p == '/') p++;
|
||||
while (*p == PATH_SEPCH) p++; /* strip leading slashes */
|
||||
path_append(buf, rbhome, p, bufsize);
|
||||
dir = buf;
|
||||
}
|
||||
|
|
@ -232,6 +232,7 @@ const char * handle_special_dirs(const char *dir, unsigned flags,
|
|||
#endif
|
||||
)
|
||||
{
|
||||
while (*dir == PATH_SEPCH) dir++; /* strip leading slashes */
|
||||
path_append(buf, PIVOT_ROOT, dir, bufsize);
|
||||
dir = buf;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue