From 2b1245e47c16c879fbe534d0007dbfe47eeda3e5 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Mon, 12 Oct 2009 00:04:11 +0000 Subject: [PATCH] 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. --- Application.mm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; -- 2.47.2