From 83b5afe296f2ce1b9e6482144668d72f88db1185 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Sun, 18 Oct 2009 19:44:09 +0000 Subject: [PATCH] Fixed serialization of function w/ CYNoLeader and implemented line tokenization for multi-line readline() events. --- Console.cpp | 3 ++- Output.cpp | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) 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_; -- 2.50.0