forked from len0rd/rockbox
make check_dir use dir_exists and slightly optimise the latter
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15744 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
afd5174eaf
commit
ed64a663a0
2 changed files with 6 additions and 13 deletions
12
apps/misc.c
12
apps/misc.c
|
|
@ -1115,12 +1115,8 @@ bool file_exists(const char *file)
|
|||
bool dir_exists(const char *path)
|
||||
{
|
||||
DIR* d = opendir(path);
|
||||
bool retval;
|
||||
if (d != NULL) {
|
||||
closedir(d);
|
||||
retval = true;
|
||||
} else {
|
||||
retval = false;
|
||||
}
|
||||
return retval;
|
||||
if (!d)
|
||||
return false;
|
||||
closedir(d);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue