summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands/CommandCompletions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Commands/CommandCompletions.cpp')
-rw-r--r--lldb/source/Commands/CommandCompletions.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lldb/source/Commands/CommandCompletions.cpp b/lldb/source/Commands/CommandCompletions.cpp
index 7b351c50dc6..fc3e8d0662d 100644
--- a/lldb/source/Commands/CommandCompletions.cpp
+++ b/lldb/source/Commands/CommandCompletions.cpp
@@ -166,7 +166,11 @@ static int DiskFilesOrDirectories(const llvm::Twine &partial_name,
size_t FullPrefixLen = CompletionBuffer.size();
PartialItem = path::filename(CompletionBuffer);
- if (PartialItem == ".")
+
+ // path::filename() will return "." when the passed path ends with a
+ // directory separator. We have to filter those out, but only when the
+ // "." doesn't come from the completion request itself.
+ if (PartialItem == "." && path::is_separator(CompletionBuffer.back()))
PartialItem = llvm::StringRef();
if (SearchDir.empty()) {
OpenPOWER on IntegriCloud