]> git.saurik.com Git - cycript.git/blobdiff - Console.cpp
Remove debugging garbage from Mach/Inject.
[cycript.git] / Console.cpp
index 3fe2310617fe7ff404a151708c6039add3f7911a..1afdb2fe93ef2c9d5f601b9458dc9ecf6c250c22 100644 (file)
@@ -141,7 +141,9 @@ static CYUTF8String Run(CYPool &pool, int client, CYUTF8String code) {
         json = NULL;
 #endif
         mode_ = Working;
-        if (json != NULL)
+        if (json == NULL)
+            size = 0;
+        else
             size = strlen(json);
     } else {
         mode_ = Sending;
@@ -334,7 +336,14 @@ static char **Complete(const char *word, int start, int end) {
         CYString *string(dynamic_cast<CYString *>(element->value_));
         _assert(string != NULL);
 
-        std::string completion(string->value_, string->size_);
+        std::string completion;
+        if (string->size_ != 0)
+            completion.assign(string->value_, string->size_);
+        else if (driver.mode_ == CYDriver::AutoMessage)
+            completion = "]";
+        else
+            continue;
+
         completions.push_back(completion);
 
         if (!rest) {