summaryrefslogtreecommitdiff
path: root/indra/llvfs/lldiriterator.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2014-03-10 15:30:38 -0700
committerMerov Linden <merov@lindenlab.com>2014-03-10 15:30:38 -0700
commit8b5ce1e474ac621fc0d8da029e710734792e319d (patch)
treed5ad22286bd84418d9ba6356017003d891165243 /indra/llvfs/lldiriterator.cpp
parentc64e878333ed86c83b0d82c10cc61d4d8d3e8af2 (diff)
parentcb91708332b8b8ddfe27808602ec5f43f11c24c2 (diff)
Pull merge from lindenlab/viewer-release
Diffstat (limited to 'indra/llvfs/lldiriterator.cpp')
-rwxr-xr-xindra/llvfs/lldiriterator.cpp23
1 files changed, 16 insertions, 7 deletions
diff --git a/indra/llvfs/lldiriterator.cpp b/indra/llvfs/lldiriterator.cpp
index 460d2a8b4f..229608231c 100755
--- a/indra/llvfs/lldiriterator.cpp
+++ b/indra/llvfs/lldiriterator.cpp
@@ -119,16 +119,25 @@ bool LLDirIterator::Impl::next(std::string &fname)
fs::directory_iterator end_itr; // default construction yields past-the-end
bool found = false;
- while (mIter != end_itr && !found)
+
+ // Check if path is a directory.
+ try
{
- boost::smatch match;
- std::string name = mIter->path().filename().string();
- if (found = boost::regex_match(name, match, mFilterExp))
+ while (mIter != end_itr && !found)
{
- fname = name;
+ boost::smatch match;
+ std::string name = mIter->path().filename().string();
+ if (found = boost::regex_match(name, match, mFilterExp))
+ {
+ fname = name;
+ }
+
+ ++mIter;
}
-
- ++mIter;
+ }
+ catch (const fs::filesystem_error& e)
+ {
+ llwarns << e.what() << llendl;
}
return found;