aboutsummaryrefslogtreecommitdiffhomepage
path: root/wutil.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-02-17 18:08:08 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-02-18 18:51:11 -0800
commit1bedc16544fb28892704f01195ebd4dd90dd1fbb (patch)
treecd986e679006cd879f6c29127fd463f219f8ceca /wutil.cpp
parentac0b97a571e4a93c2aa8232b3df1ac8cc7f1f361 (diff)
Enhanced directory detection in a way we don't actually need yet
Diffstat (limited to 'wutil.cpp')
-rw-r--r--wutil.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/wutil.cpp b/wutil.cpp
index 07fe9f1d..a9598837 100644
--- a/wutil.cpp
+++ b/wutil.cpp
@@ -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;
}