diff options
author | simon <none@none> | 2013-11-25 11:12:57 -0800 |
---|---|---|
committer | simon <none@none> | 2013-11-25 11:12:57 -0800 |
commit | 97b932c4057984856b0398ee98377e3b6d964424 (patch) | |
tree | ff107afccc8317514e234143615bdea49a2d002c /indra/llvfs/lldiriterator.cpp | |
parent | 5756b7b3d05ce330e9877650ba6af04aaa4da49d (diff) | |
parent | e28bd4612e2ce7760a13fde59580badb1cbaebd3 (diff) |
Merge last changes for DRTVWR-345
Diffstat (limited to 'indra/llvfs/lldiriterator.cpp')
-rwxr-xr-x | indra/llvfs/lldiriterator.cpp | 23 |
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; |