From c129a1a923ddeaed58458dc849eec10b24569313 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Mon, 29 Aug 2011 03:35:08 -0500 Subject: [PATCH] Small LLVFS (LLDirIterator specifically) tweak regarding path existance detection. --- indra/llvfs/lldiriterator.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/indra/llvfs/lldiriterator.cpp b/indra/llvfs/lldiriterator.cpp index 8afbb63ae..a0f319a90 100644 --- a/indra/llvfs/lldiriterator.cpp +++ b/indra/llvfs/lldiriterator.cpp @@ -51,8 +51,24 @@ 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); + } +#if BOOST_FILESYSTEM_VERSION >= 3 + catch (fs::filesystem_error& e) +#else + catch (fs::basic_filesystem_error& e) +#endif + { + llwarns << e.what() << llendl; + return; + } + + if (!is_dir) { llwarns << "Invalid path: \"" << dir_path.string() << "\"" << llendl; return;