/* Cycript - Optimizing JavaScript Compiler/Runtime
- * Copyright (C) 2009-2014 Jay Freeman (saurik)
+ * Copyright (C) 2009-2015 Jay Freeman (saurik)
*/
/* GNU Affero General Public License, Version 3 {{{ */
case Parsing:
longjmp(ctrlc_, 1);
case Running:
- throw "*** Ctrl-C";
+ CYCancel();
+ return;
case Sending:
return;
case Waiting:
// need char *, not const char *
static char name_[] = "cycript";
-static char break_[] = " \t\n\"\\'`@$><=;|&{(" ")}" ".:[]";
+static char break_[] = " \t\n\"\\'`@><=;|&{(" ")}" ".:[]";
class History {
private:
if (parser.parse() != 0 || !driver.errors_.empty()) {
for (CYDriver::Errors::const_iterator error(driver.errors_.begin()); error != driver.errors_.end(); ++error) {
- cy::position begin(error->location_.begin);
+ CYPosition begin(error->location_.begin);
if (begin.line != lines.size() || begin.column < lines.back().size() || error->warning_) {
- cy::position end(error->location_.end);
+ CYPosition end(error->location_.end);
if (begin.line != lines.size()) {
std::cerr << " | ";
}
}
-void InjectLibrary(pid_t pid);
+void InjectLibrary(pid_t, int, const char *[]);
int Main(int argc, char * const argv[], char const * const envp[]) {
bool tty(isatty(STDIN_FILENO));
memset(&address, 0, sizeof(address));
address.sun_family = AF_UNIX;
- sprintf(address.sun_path, "/tmp/.s.cy.%u", getpid());
+ const char *tmp;
+#if defined(__APPLE__) && (defined(__arm__) || defined(__arm64__))
+ tmp = "/Library/Caches";
+#else
+ tmp = "/tmp";
+#endif
+
+ sprintf(address.sun_path, "%s/.s.cy.%u", tmp, getpid());
unlink(address.sun_path);
struct File {
_syscall(chmod(address.sun_path, 0777));
_syscall(listen(server, 1));
- InjectLibrary(pid);
+ InjectLibrary(pid, 1, (const char *[]) {address.sun_path, NULL});
client_ = _syscall(accept(server, NULL, NULL));
}
#else