From: Jay Freeman (saurik) Date: Mon, 12 Oct 2009 00:04:11 +0000 (+0000) Subject: Fix line numbers of errors caused in executed scripts due to lopping off the first... X-Git-Tag: v0.9.432~354 X-Git-Url: https://git.saurik.com/cycript.git/commitdiff_plain/2b1245e47c16c879fbe534d0007dbfe47eeda3e5 Fix line numbers of errors caused in executed scripts due to lopping off the first line, removed CYApplicationMain temporary hack, implemented new Pointer for binding a type to an address, and slightly rearranged gcc makefile arguments. --- diff --git a/Application.mm b/Application.mm index 46b24ac..e910f66 100644 --- a/Application.mm +++ b/Application.mm @@ -244,7 +244,11 @@ int main(int argc, const char *argv[]) { if (size >= 2 && start[0] == '#' && start[1] == '!') { start += 2; - while (start != end && *start++ != '\n'); + + if (void *line = memchr(start, '\n', end - start)) + start = reinterpret_cast(line); + else + start = end; } driver.data_ = start;