From: Jay Freeman (saurik) Date: Sun, 18 Oct 2009 19:44:09 +0000 (+0000) Subject: Fixed serialization of function w/ CYNoLeader and implemented line tokenization for... X-Git-Tag: v0.9.432~321 X-Git-Url: https://git.saurik.com/cycript.git/commitdiff_plain/83b5afe296f2ce1b9e6482144668d72f88db1185 Fixed serialization of function w/ CYNoLeader and implemented line tokenization for multi-line readline() events. --- diff --git a/Console.cpp b/Console.cpp index 468a6d3..d938217 100644 --- a/Console.cpp +++ b/Console.cpp @@ -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; diff --git a/Output.cpp b/Output.cpp index 3774a6a..a73b9c9 100644 --- a/Output.cpp +++ b/Output.cpp @@ -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_;