summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands/CommandCompletions.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-04-15 02:44:53 +0000
committerZachary Turner <zturner@google.com>2017-04-15 02:44:53 +0000
commit426d1379b081bee95841c36595bd058794aa60fe (patch)
tree5a5a2c63f7c29ad90d020029076c1fcd362b4ecb /lldb/source/Commands/CommandCompletions.cpp
parent0eb8030369910abae3ddb10141f798b1728967e2 (diff)
downloadbcm5719-llvm-426d1379b081bee95841c36595bd058794aa60fe.tar.gz
bcm5719-llvm-426d1379b081bee95841c36595bd058794aa60fe.zip
Fix crash when completing in the current directory.
llvm-svn: 300386
Diffstat (limited to 'lldb/source/Commands/CommandCompletions.cpp')
-rw-r--r--lldb/source/Commands/CommandCompletions.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lldb/source/Commands/CommandCompletions.cpp b/lldb/source/Commands/CommandCompletions.cpp
index 5f0d494443f..fd84e1c4f85 100644
--- a/lldb/source/Commands/CommandCompletions.cpp
+++ b/lldb/source/Commands/CommandCompletions.cpp
@@ -176,7 +176,10 @@ static int DiskFilesOrDirectories(const llvm::Twine &partial_name,
if (PartialItem == ".")
PartialItem = llvm::StringRef();
- assert(!SearchDir.empty());
+ if (SearchDir.empty()) {
+ llvm::sys::fs::current_path(Storage);
+ SearchDir = Storage;
+ }
assert(!PartialItem.contains(path::get_separator()));
// SearchDir now contains the directory to search in, and Prefix contains the
OpenPOWER on IntegriCloud