!203 fix rm -r crash when opendir failed
Merge pull request !203 from 野生毛霉君/master
This commit is contained in:
commit
c1b2b3c73e
|
@ -837,6 +837,10 @@ static int os_shell_cmd_do_rmdir(const char *pathname)
|
||||||
return remove(pathname);
|
return remove(pathname);
|
||||||
}
|
}
|
||||||
d = opendir(pathname);
|
d = opendir(pathname);
|
||||||
|
if (d == NULL)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
dirent = readdir(d);
|
dirent = readdir(d);
|
||||||
|
|
Loading…
Reference in New Issue