Reject '//' as a file completion prefix to avoid cygwin network hosts listing

This commit is contained in:
Maxime Coste 2016-05-19 21:46:27 +01:00
parent 1834a67b87
commit 365887539b

View File

@ -205,6 +205,11 @@ InsertCompletion complete_filename(const SelectionList& sels,
if (require_slash and not contains(prefix, '/'))
return {};
// Do not try to complete in that case as its unlikely to be a filename,
// and triggers network host search of cygwin.
if (prefix.substr(0_byte, 2_byte) == "//")
return {};
InsertCompletion::CandidateList candidates;
if (prefix.front() == '/' or prefix.front() == '~')
{