diff options
| author | Raphael Isemann <teemperor@gmail.com> | 2018-06-18 20:11:38 +0000 |
|---|---|---|
| committer | Raphael Isemann <teemperor@gmail.com> | 2018-06-18 20:11:38 +0000 |
| commit | 4621e0b058116dc817fb018add5ad77bfc27f98e (patch) | |
| tree | 916d7f368651fa935b272e2b42551a46df5ad36b | |
| parent | 3e52deb1448024d14e5f445fc221dc25a905ecf7 (diff) | |
| download | bcm5719-llvm-4621e0b058116dc817fb018add5ad77bfc27f98e.tar.gz bcm5719-llvm-4621e0b058116dc817fb018add5ad77bfc27f98e.zip | |
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
| -rw-r--r-- | lldb/source/Commands/CommandCompletions.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lldb/source/Commands/CommandCompletions.cpp b/lldb/source/Commands/CommandCompletions.cpp index b1418334c96..dbb0b7e9469 100644 --- a/lldb/source/Commands/CommandCompletions.cpp +++ b/lldb/source/Commands/CommandCompletions.cpp @@ -164,6 +164,12 @@ static int DiskFilesOrDirectories(const llvm::Twine &partial_name, // 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); |

