diff options
author | Oz Linden <oz@lindenlab.com> | 2011-07-22 09:06:42 -0400 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2011-07-22 09:06:42 -0400 |
commit | ebbadcf7720cfcbdf5da99ad219de4e7edcf0c6f (patch) | |
tree | b7782e3c46284e99c3bb9ef081ce4cc8f04d292a /indra/llvfs/lldiriterator.cpp | |
parent | d26356d7e16191da90cae23d3871d4e7289e175f (diff) | |
parent | f45747e52401569c0ee489d7f408cf00f4c58149 (diff) |
merge changes from snowstorm team review build
Diffstat (limited to 'indra/llvfs/lldiriterator.cpp')
-rw-r--r-- | indra/llvfs/lldiriterator.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/indra/llvfs/lldiriterator.cpp b/indra/llvfs/lldiriterator.cpp index 25550321f0..ff92cbb7fd 100644 --- a/indra/llvfs/lldiriterator.cpp +++ b/indra/llvfs/lldiriterator.cpp @@ -52,8 +52,20 @@ LLDirIterator::Impl::Impl(const std::string &dirname, const std::string &mask) { fs::path dir_path(dirname); - // Check if path exists. - if (!fs::exists(dir_path)) + bool is_dir = false; + + // Check if path is a directory. + try + { + is_dir = fs::is_directory(dir_path); + } + catch (fs::basic_filesystem_error<fs::path>& e) + { + llwarns << e.what() << llendl; + return; + } + + if (!is_dir) { llwarns << "Invalid path: \"" << dir_path.string() << "\"" << llendl; return; @@ -66,7 +78,7 @@ LLDirIterator::Impl::Impl(const std::string &dirname, const std::string &mask) } catch (fs::basic_filesystem_error<fs::path>& e) { - llerrs << e.what() << llendl; + llwarns << e.what() << llendl; return; } @@ -82,7 +94,7 @@ LLDirIterator::Impl::Impl(const std::string &dirname, const std::string &mask) } catch (boost::regex_error& e) { - llerrs << "\"" << exp << "\" is not a valid regular expression: " + llwarns << "\"" << exp << "\" is not a valid regular expression: " << e.what() << llendl; return; } |