diff options
Diffstat (limited to 'indra/llvfs')
-rw-r--r-- | indra/llvfs/CMakeLists.txt | 10 | ||||
-rw-r--r-- | indra/llvfs/lldiriterator.cpp | 20 |
2 files changed, 21 insertions, 9 deletions
diff --git a/indra/llvfs/CMakeLists.txt b/indra/llvfs/CMakeLists.txt index 2c581cf8d6..a819d12861 100644 --- a/indra/llvfs/CMakeLists.txt +++ b/indra/llvfs/CMakeLists.txt @@ -83,13 +83,13 @@ if (LL_TESTS) include(LLAddBuildTest) # UNIT TESTS SET(llvfs_TEST_SOURCE_FILES - lldiriterator.cpp - ) + lldiriterator.cpp + ) set_source_files_properties(lldiriterator.cpp - PROPERTIES - LL_TEST_ADDITIONAL_LIBRARIES "${vfs_BOOST_LIBRARIES}" - ) + PROPERTIES + LL_TEST_ADDITIONAL_LIBRARIES "${vfs_BOOST_LIBRARIES}" + ) LL_ADD_PROJECT_UNIT_TESTS(llvfs "${llvfs_TEST_SOURCE_FILES}") # INTEGRATION TESTS 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; } |