diff options
author | Monty Brandenberg <monty@lindenlab.com> | 2014-03-10 20:34:43 -0400 |
---|---|---|
committer | Monty Brandenberg <monty@lindenlab.com> | 2014-03-10 20:34:43 -0400 |
commit | 9c29000ba2f8192985ad0bf20889739ad12dd569 (patch) | |
tree | 3670a18100453ef589a04d40da5aa314b99f5d11 /indra/llvfs/lldiriterator.cpp | |
parent | 71e237a3f79cd90b432205460fe6e5c6b536d9db (diff) | |
parent | cb91708332b8b8ddfe27808602ec5f43f11c24c2 (diff) |
Merge. Refresh from viewer-release after 3.7.3 release.
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; |