X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/89a95d4776098c0d70653eebdc4f455f2e8e341d..e257405a21801819aa1f5262b0c373c03fabbd58:/Console.cpp diff --git a/Console.cpp b/Console.cpp index f4f5b10..db86eb8 100644 --- a/Console.cpp +++ b/Console.cpp @@ -400,6 +400,9 @@ class History { } } void operator +=(std::string command) { + if (HIST_ENTRY *entry = history_get(where_history())) + if (command == entry->line) + return; add_history(command.c_str()); ++histlines_; } @@ -674,13 +677,13 @@ static void Console(CYOptions &options) { CYOutputRun(""); - struct sigaction action; - sigemptyset(&action.sa_mask); - action.sa_handler = &sigint; - action.sa_flags = 0; - sigaction(SIGINT, &action, NULL); - for (;;) { + struct sigaction action; + sigemptyset(&action.sa_mask); + action.sa_handler = &sigint; + action.sa_flags = 0; + sigaction(SIGINT, &action, NULL); + if (setjmp(ctrlc_) != 0) { mode_ = Working; *out_ << std::endl;