FIO: Fix directory scanning logic to avoid errors handling files in /
This commit is contained in:
parent
190baf897c
commit
5a59fe81fc
1 changed files with 3 additions and 1 deletions
|
@ -782,7 +782,9 @@ else {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
strlcpy (fullpath, dir, tot_len);
|
strlcpy (fullpath, dir, tot_len);
|
||||||
strlcat (fullpath, "/", tot_len);
|
if ((dir[strlen (dir) - 1] != '/') && /* if missing a trailing directory separator? */
|
||||||
|
(dir[strlen (dir) - 1] != '\\'))
|
||||||
|
strlcat (fullpath, "/", tot_len); /* then add one */
|
||||||
strlcat (fullpath, filepath, tot_len);
|
strlcat (fullpath, filepath, tot_len);
|
||||||
}
|
}
|
||||||
while ((c = strchr (fullpath, '\\'))) /* standardize on / directory separator */
|
while ((c = strchr (fullpath, '\\'))) /* standardize on / directory separator */
|
||||||
|
|
Loading…
Add table
Reference in a new issue