summaryrefslogtreecommitdiff
path: root/src/file.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2013-03-14 13:42:07 +0100
committerMaxime Coste <frrrwww@gmail.com>2013-03-14 13:42:07 +0100
commit50d9c4dfda725731c9c848aa080efede2be52708 (patch)
tree8c6449067c5a1cc91398b2726ea686c05807d1ec /src/file.cc
parent0b45a725e4aa5129339f225ed75fbff1a04dbf09 (diff)
add support for regex options, make ignored_files one
Diffstat (limited to 'src/file.cc')
-rw-r--r--src/file.cc10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/file.cc b/src/file.cc
index 2922a835..bc8ce4a8 100644
--- a/src/file.cc
+++ b/src/file.cc
@@ -217,7 +217,7 @@ static boost::regex make_regex_ifp(const String& ex)
}
std::vector<String> complete_filename(const String& prefix,
- const String& ignored_regex,
+ const Regex& ignored_regex,
ByteCount cursor_pos)
{
String real_prefix = parse_filename(prefix.substr(0, cursor_pos));
@@ -225,8 +225,6 @@ std::vector<String> complete_filename(const String& prefix,
String dirprefix;
String fileprefix = real_prefix;
- boost::regex ignored_files = make_regex_ifp(ignored_regex);
-
ByteCount dir_end = -1;
for (ByteCount i = 0; i < real_prefix.length(); ++i)
{
@@ -247,8 +245,8 @@ std::vector<String> complete_filename(const String& prefix,
if (not dir)
return result;
- const bool check_ignored_files = not ignored_files.empty() and
- not boost::regex_match(fileprefix.c_str(), ignored_files);
+ const bool check_ignored_regex = not ignored_regex.empty() and
+ not boost::regex_match(fileprefix.c_str(), ignored_regex);
boost::regex file_regex = make_regex_ifp(fileprefix);
std::vector<String> regex_result;
@@ -258,7 +256,7 @@ std::vector<String> complete_filename(const String& prefix,
if (filename.empty())
continue;
- if (check_ignored_files and boost::regex_match(filename.c_str(), ignored_files))
+ if (check_ignored_regex and boost::regex_match(filename.c_str(), ignored_regex))
continue;
const bool match_prefix = (filename.substr(0, fileprefix.length()) == fileprefix);