summaryrefslogtreecommitdiff
path: root/indra/llvfs/lldiriterator.cpp
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2011-08-03 14:13:12 -0400
committerOz Linden <oz@lindenlab.com>2011-08-03 14:13:12 -0400
commit299e18e588338d19a40a4b9944e9ddd31216b0c8 (patch)
tree985a3fe37b693cf377c953a880c967f5e29b2abc /indra/llvfs/lldiriterator.cpp
parent01ee25cca43b175567859becd1eacf77db24af55 (diff)
parent93099e22897c8650927b0dc90a4a38e2a7cf81d8 (diff)
Automated merge with file:///Users/oz/Work/V-PR
Diffstat (limited to 'indra/llvfs/lldiriterator.cpp')
-rw-r--r--indra/llvfs/lldiriterator.cpp20
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;
}