Skip to content

Commit 4621e0b

Browse files
committed
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 llvm-svn: 334978
1 parent 3e52deb commit 4621e0b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lldb/source/Commands/CommandCompletions.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,12 @@ static int DiskFilesOrDirectories(const llvm::Twine &partial_name,
164164
// search in the fully resolved directory, but CompletionBuffer keeps the
165165
// unmodified form that the user typed.
166166
Storage = Resolved;
167+
llvm::StringRef RemainderDir = path::parent_path(Remainder.str());
168+
if (!RemainderDir.empty()) {
169+
// Append the remaining path to the resolved directory.
170+
Storage.append(path::get_separator());
171+
Storage.append(RemainderDir);
172+
}
167173
SearchDir = Storage;
168174
} else {
169175
SearchDir = path::parent_path(CompletionBuffer);

0 commit comments

Comments
 (0)