S_ISDIR bug (NDS)
Homebrew toolchains for wii, gamecube, 3ds, ds, gba, gp32 and psp
Brought to you by:
wntrmute
The S_ISDIR() function does not return the right answer when querying a subdirectory (everything is fin though for the root dir).
For example : opendir("/dir1") -> querying the type of every element in this subdirectory reports every one of them as a file.
Althought, everything is fine when you first chdir("/dir1"), opendir("."), and then query every element in there.
This bug happens on NDS, but I didn't try for the other platforms.
See this post on gbadev.org
http://forum.gbadev.org/viewtopic.php?t=16272
you're not allowing for the directory on the stat call.