- Readline:
. Fixed bug #55496 (Interactive mode doesn't force a newline before the
prompt). (Bob, Johannes)
+ . Fixed bug #67496 (Save command history when exiting interactive shell
+ with control-c). (Dmitry Saprykin, Johannes)
?? ??? 2014, PHP 5.4.31
char *code = emalloc(size);
char *prompt = cli_get_prompt("php", '>' TSRMLS_CC);
char *history_file;
+ int history_lines_to_write = 0;
if (PG(auto_prepend_file) && PG(auto_prepend_file)[0]) {
zend_file_handle *prepend_file_p;
if (*line) {
add_history(line);
+ history_lines_to_write += 1;
}
free(line);
continue;
}
+ if (history_lines_to_write) {
+#if HAVE_LIBEDIT
+ write_history(history_file);
+#else
+ append_history(history_lines_to_write, history_file);
+#endif
+ history_lines_to_write = 0;
+ }
+
zend_try {
zend_eval_stringl(code, pos, NULL, "php shell code" TSRMLS_CC);
} zend_end_try();
php_last_char = '\0';
}
- write_history(history_file);
free(history_file);
efree(code);
efree(prompt);