application: fix opendir() for "/" directory.
"/" couldn't be opened. This regression was introduced by 731072d
. Trailing
slash should not be stripped for the root directory.
Change-Id: Idd2d9b1f33e7be789bcf432e586e6715eb4152f4
This commit is contained in:
parent
191bd3da93
commit
6b01da8bed
1 changed files with 1 additions and 1 deletions
|
@ -343,7 +343,7 @@ DIR* app_opendir(const char *_name)
|
||||||
struct __dir *this = (struct __dir*)buf;
|
struct __dir *this = (struct __dir*)buf;
|
||||||
/* carefully remove any trailing slash from the input, so that
|
/* carefully remove any trailing slash from the input, so that
|
||||||
* hash/path matching in readdir() works properly */
|
* hash/path matching in readdir() works properly */
|
||||||
while (name[name_len-1] == '/')
|
while (name[name_len-1] == '/' && name_len > 1)
|
||||||
name_len -= 1;
|
name_len -= 1;
|
||||||
/* strcpy cannot be used because of trailing slashes */
|
/* strcpy cannot be used because of trailing slashes */
|
||||||
memcpy(this->path, name, name_len);
|
memcpy(this->path, name, name_len);
|
||||||
|
|
Loading…
Reference in a new issue