]> git.saurik.com Git - cycript.git/commitdiff
Fixed serialization of function w/ CYNoLeader and implemented line tokenization for...
authorJay Freeman (saurik) <saurik@saurik.com>
Sun, 18 Oct 2009 19:44:09 +0000 (19:44 +0000)
committerJay Freeman (saurik) <saurik@saurik.com>
Sun, 18 Oct 2009 19:44:09 +0000 (19:44 +0000)
Console.cpp
Output.cpp

index 468a6d3d0da222a383c705f62284cd738049bb5e..d938217b353dd33797902784b70c3b28a96db8e8 100644 (file)
@@ -179,8 +179,9 @@ static void Console(int socket) {
             }
         }
 
-        lines.push_back(line);
         command += line;
+        for (char *state, *token(apr_strtok(line, "\n", &state)); token != NULL; token = apr_strtok(NULL, "\n", &state))
+            lines.push_back(token);
         free(line);
 
         std::string code;
index 3774a6ab87947e7c2a5807c0ca85a44f171dc486..a73b9c95866b4389f97760e39ff79027c0c1313f 100644 (file)
@@ -388,6 +388,8 @@ void CYLambda::Output(std::ostream &out, CYFlags flags) const {
     bool protect((flags & CYNoFunction) != 0);
     if (protect)
         out << '(';
+    else if ((flags & CYNoLeader) != 0)
+        out << ' ';
     out << "function";
     if (name_ != NULL)
         out << ' ' << *name_;