]> git.saurik.com Git - cycript.git/commitdiff
Call rl_newline instead of attempting to simulate.
authorJay Freeman (saurik) <saurik@saurik.com>
Wed, 9 Dec 2015 20:50:40 +0000 (12:50 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Wed, 9 Dec 2015 20:50:40 +0000 (12:50 -0800)
Console.cpp

index 463189c25a24ae44f01fd84a5a526c33de0b1848..164438c8228e72be21ae62683403c5476f96fd2c 100644 (file)
@@ -384,8 +384,9 @@ class History {
 static int CYConsoleKeyReturn(int count, int key) {
     rl_insert(count, '\n');
 
+    bool done(false);
     if (rl_end != 0 && rl_point == rl_end && rl_line_buffer[0] == '?')
-        rl_done = 1;
+        done = true;
     else if (rl_point == rl_end) {
         std::string command(rl_line_buffer, rl_end);
         std::istringstream stream(command);
@@ -399,15 +400,15 @@ static int CYConsoleKeyReturn(int count, int key) {
         if (driver.Parse() || !driver.errors_.empty())
             for (CYDriver::Errors::const_iterator error(driver.errors_.begin()); error != driver.errors_.end(); ++error) {
                 if (error->location_.begin.line != last + 1)
-                    rl_done = 1;
+                    done = true;
                 break;
             }
         else
-            rl_done = 1;
+            done = true;
     }
 
-    if (rl_done)
-        std::cout << std::endl;
+    if (done)
+        return rl_newline(count, key);
     return 0;
 }