Completion: handle hidden files in complete_filenam
This commit is contained in:
parent
49ea6f7103
commit
f673f3c334
|
@ -30,11 +30,15 @@ CandidateList complete_filename(const std::string& prefix,
|
|||
while (dirent* entry = readdir(dir))
|
||||
{
|
||||
std::string filename = entry->d_name;
|
||||
if (filename.empty())
|
||||
continue;
|
||||
|
||||
if (filename.substr(0, fileprefix.length()) == fileprefix)
|
||||
{
|
||||
std::string name = dirprefix + filename;
|
||||
if (entry->d_type == DT_DIR)
|
||||
name += '/';
|
||||
if (fileprefix.length() or filename[0] != '.')
|
||||
result.push_back(name);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user