diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2011-08-10 17:53:11 -0400 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2011-08-10 17:53:11 -0400 |
commit | 6732f5fbca2dc83ec1cf6fcb31b5a6657e8d040f (patch) | |
tree | 48165a2aa3aed2133d1d79742e3d64cce3ca2b01 /indra/llvfs | |
parent | 20c3d8485480487d38500c9b18846ca96d1d6f83 (diff) | |
parent | c7b6a25728cd360348d1c3da5ace0971767206a4 (diff) |
merge viewer-development to mesh-development
Diffstat (limited to 'indra/llvfs')
-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; } |