summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2016-11-18 09:37:16 +0000
committerMaxime Coste <frrrwww@gmail.com>2016-11-18 09:38:48 +0000
commit67eb19c6d2d4b4aaa593e526b625483ca5a7e207 (patch)
treeabfd9cb2811c0b9305920ac5c0f7ca5a15ecf08d /src
parent8e569179847bf0af6cce7a6306adf440883c7650 (diff)
Only rely on `ignored_files` option to remove hidden files, no built in logic
Fixes #929
Diffstat (limited to 'src')
-rw-r--r--src/file.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/file.cc b/src/file.cc
index 16b3cf04..9620467a 100644
--- a/src/file.cc
+++ b/src/file.cc
@@ -401,14 +401,12 @@ CandidateList complete_filename(StringView prefix, const Regex& ignored_regex,
const bool check_ignored_regex = not ignored_regex.empty() and
not regex_match(fileprefix.begin(), fileprefix.end(), ignored_regex);
- const bool include_hidden = fileprefix.substr(0_byte, 1_byte) == ".";
const bool only_dirs = (flags & FilenameFlags::OnlyDirectories);
- auto filter = [&ignored_regex, check_ignored_regex, include_hidden, only_dirs](const dirent& entry, struct stat& st)
+ auto filter = [&ignored_regex, check_ignored_regex, only_dirs](const dirent& entry, struct stat& st)
{
StringView name{entry.d_name};
- return (include_hidden or name.substr(0_byte, 1_byte) != ".") and
- (not check_ignored_regex or not regex_match(name.begin(), name.end(), ignored_regex)) and
+ return (not check_ignored_regex or not regex_match(name.begin(), name.end(), ignored_regex)) and
(not only_dirs or S_ISDIR(st.st_mode));
};
auto files = list_files(parsed_dirname, filter);