diff options
author | Nyx (Neal Orman) <nyx@lindenlab.com> | 2011-07-26 15:51:44 -0400 |
---|---|---|
committer | Nyx (Neal Orman) <nyx@lindenlab.com> | 2011-07-26 15:51:44 -0400 |
commit | 60d15f78e17a2203d73d58c3f1c2af941d599277 (patch) | |
tree | 58da32e9df5e9727e437efa90e98a0d4d2a3b0e9 /indra/llvfs/lldiriterator.cpp | |
parent | 85b316e5df41444eafe77964f1a4758ccfd40784 (diff) | |
parent | f79a058f3ce50361b732061ab30f4a1923fba445 (diff) |
merge with latest mesh-dev
Diffstat (limited to 'indra/llvfs/lldiriterator.cpp')
-rw-r--r-- | indra/llvfs/lldiriterator.cpp | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/indra/llvfs/lldiriterator.cpp b/indra/llvfs/lldiriterator.cpp index 5536ed8f69..25550321f0 100644 --- a/indra/llvfs/lldiriterator.cpp +++ b/indra/llvfs/lldiriterator.cpp @@ -55,7 +55,7 @@ LLDirIterator::Impl::Impl(const std::string &dirname, const std::string &mask) // Check if path exists. if (!fs::exists(dir_path)) { - llerrs << "Invalid path: \"" << dir_path.string() << "\"" << llendl; + llwarns << "Invalid path: \"" << dir_path.string() << "\"" << llendl; return; } @@ -100,7 +100,7 @@ bool LLDirIterator::Impl::next(std::string &fname) if (!mIsValid) { - llerrs << "The iterator is not correctly initialized." << llendl; + llwarns << "The iterator is not correctly initialized." << llendl; return false; } @@ -121,6 +121,14 @@ bool LLDirIterator::Impl::next(std::string &fname) return found; } +/** +Converts the incoming glob into a regex. This involves +converting incoming glob expressions to regex equivilents and +at the same time, escaping any regex meaningful characters which +do not have glob meaning, i.e. + .()+|^$ +in the input. +*/ std::string glob_to_regex(const std::string& glob) { std::string regex; @@ -135,9 +143,6 @@ std::string glob_to_regex(const std::string& glob) switch (c) { - case '.': - regex+="\\."; - break; case '*': if (glob.begin() == i) { @@ -170,8 +175,16 @@ std::string glob_to_regex(const std::string& glob) case '!': regex+= square_brace_open ? '^' : c; break; + case '.': // This collection have different regex meaning + case '^': // and so need escaping. + case '(': + case ')': + case '+': + case '|': + case '$': + regex += '\\'; default: - regex+=c; + regex += c; break; } |