From: Jay Freeman (saurik) Date: Tue, 27 Apr 2010 21:09:02 +0000 (+0000) Subject: Cut off messages prefixes. X-Git-Tag: v0.9.432~58 X-Git-Url: https://git.saurik.com/cycript.git/commitdiff_plain/2a18313c2254df5864f7ad60f2e89d1cfc7a8efc?ds=inline Cut off messages prefixes. --- diff --git a/Console.cpp b/Console.cpp index 91d389c..c4303f6 100644 --- a/Console.cpp +++ b/Console.cpp @@ -290,18 +290,19 @@ static char **Complete(const char *word, int start, int end) { _assert(false); } - std::string begin(prefix.str() + word); + std::string begin(prefix.str()); - driver.program_ = $ CYProgram($ CYExpress($C2(ParseExpression(pool, - " function(object, prefix) {\n" + driver.program_ = $ CYProgram($ CYExpress($C3(ParseExpression(pool, + " function(object, prefix, word) {\n" " var names = [];\n" - " var pattern = '^' + prefix;\n" + " var pattern = '^' + prefix + word;\n" + " var length = prefix.length;\n" " for (name in object)\n" " if (name.match(pattern) != null)\n" - " names.push(name);\n" + " names.push(name.substr(length));\n" " return names;\n" " }\n" - ), expression, $S(begin.c_str())))); + ), expression, $S(begin.c_str()), $S(word)))); driver.program_->Replace(context);