]> git.saurik.com Git - cycript.git/blobdiff - Console.cpp
Support having multiple language hooks registered.
[cycript.git] / Console.cpp
index 209eef30b8040a858195667111d6dde96dfdcdfc..7a73c882bcf3bfe86af1249c7e79539ee13b03a1 100644 (file)
@@ -1,21 +1,21 @@
 /* Cycript - Optimizing JavaScript Compiler/Runtime
- * Copyright (C) 2009-2013  Jay Freeman (saurik)
+ * Copyright (C) 2009-2014  Jay Freeman (saurik)
 */
 
-/* GNU General Public License, Version 3 {{{ */
+/* GNU Affero General Public License, Version 3 {{{ */
 /*
- * Cycript is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation, either version 3 of the License,
- * or (at your option) any later version.
- *
- * Cycript is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Cycript.  If not, see <http://www.gnu.org/licenses/>.
+ * GNU Affero General Public License for more details.
+
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 **/
 /* }}} */
 
@@ -403,7 +403,8 @@ class History {
 
     ~History() {
         if (append_history$ != NULL) {
-            _syscall(close(_syscall(open(histfile_.c_str(), O_CREAT | O_WRONLY, 0600))));
+            int fd(_syscall(open(histfile_.c_str(), O_CREAT | O_WRONLY, 0600)));
+            _syscall(close(fd));
             _assert((*append_history$)(histlines_, histfile_.c_str()) == 0);
         } else {
             _assert(write_history(histfile_.c_str()) == 0);
@@ -633,7 +634,7 @@ int Main(int argc, char * const argv[], char const * const envp[]) {
 #endif
             "r:"
             "s"
-        , (struct option[]) {
+        , (const struct option[]) {
             {NULL, no_argument, NULL, 'c'},
             {NULL, required_argument, NULL, 'g'},
             {NULL, required_argument, NULL, 'n'},