Author: teemperor
Date: Mon Jun 18 13:11:38 2018
New Revision: 334978
URL: http://llvm.org/viewvc/llvm-project?rev=334978&view=rev
Log:
Fixed file completion for paths that start with '~'.
We didn't add the remaining path behind the '~' to the completion string,
causing it to just complete directories inside the user home directory. This
patch just adds the directory of the remaining path if there is one.
Fixes rdar://problem/40147002
Modified:
lldb/trunk/source/Commands/CommandCompletions.cpp
Modified: lldb/trunk/source/Commands/CommandCompletions.cpp
URL:
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandCompletions.cpp?rev=334978&r1=334977&r2=334978&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandCompletions.cpp (original)
+++ lldb/trunk/source/Commands/CommandCompletions.cpp Mon Jun 18 13:11:38 2018
@@ -164,6 +164,12 @@ static int DiskFilesOrDirectories(const
// search in the fully resolved directory, but CompletionBuffer keeps the
// unmodified form that the user typed.
Storage = Resolved;
+ llvm::StringRef RemainderDir = path::parent_path(Remainder.str());
+ if (!RemainderDir.empty()) {
+ // Append the remaining path to the resolved directory.
+ Storage.append(path::get_separator());
+ Storage.append(RemainderDir);
+ }
SearchDir = Storage;
} else {
SearchDir = path::parent_path(CompletionBuffer);
_______________________________________________
lldb-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits