diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2012-02-17 18:08:08 -0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2012-02-18 18:51:11 -0800 |
commit | 1bedc16544fb28892704f01195ebd4dd90dd1fbb (patch) | |
tree | cd986e679006cd879f6c29127fd463f219f8ceca /wutil.cpp | |
parent | ac0b97a571e4a93c2aa8232b3df1ac8cc7f1f361 (diff) |
Enhanced directory detection in a way we don't actually need yet
Diffstat (limited to 'wutil.cpp')
-rw-r--r-- | wutil.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -82,13 +82,15 @@ void wutil_destroy() { } -std::wstring *wreaddir(DIR *dir, std::wstring &outPath) +bool wreaddir(DIR *dir, std::wstring &outPath, bool *is_dir) { struct dirent *d = readdir( dir ); - if ( !d ) return 0; + if ( !d ) return false; outPath = str2wcstring(d->d_name); - return &outPath; + if (is_dir) + *is_dir = (d->d_type == DT_DIR); + return true; } |