diff --git a/indra/llvfs/lldiriterator.cpp b/indra/llvfs/lldiriterator.cpp
index a9d96c980728954a892b22630ec890c5e9bc5119..76296ff877d4fa7e462cac628376211902d5f73c 100755
--- a/indra/llvfs/lldiriterator.cpp
+++ b/indra/llvfs/lldiriterator.cpp
@@ -127,7 +127,8 @@ bool LLDirIterator::Impl::next(std::string &fname)
 		{
 			boost::smatch match;
 			std::string name = mIter->path().filename().string();
-			if (found = boost::regex_match(name, match, mFilterExp))
+			found = boost::regex_match(name, match, mFilterExp);
+			if (found)
 			{
 				fname = name;
 			}