summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-01-25 09:41:40 -0800
committerBrion Vibber <brion@pobox.com>2010-01-25 09:41:40 -0800
commitee4ca8f2601bc5a2dd258fea176037e03e23feb8 (patch)
tree4f0dbdd1247de846be904d1565a7260ae182fcc3
parent055a00bcaeaa50c36143bd151bf4433c5c87d174 (diff)
quick fix to console.php: don't save blank lines into readline history
-rwxr-xr-xscripts/console.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/scripts/console.php b/scripts/console.php
index 8b62a3a96..4d207c261 100755
--- a/scripts/console.php
+++ b/scripts/console.php
@@ -45,10 +45,12 @@ function read_input_line($prompt)
if (CONSOLE_INTERACTIVE) {
if (CONSOLE_READLINE) {
$line = readline($prompt);
- readline_add_history($line);
- if (defined('CONSOLE_HISTORY')) {
- // Save often; it's easy to hit fatal errors.
- readline_write_history(CONSOLE_HISTORY);
+ if (trim($line) != '') {
+ readline_add_history($line);
+ if (defined('CONSOLE_HISTORY')) {
+ // Save often; it's easy to hit fatal errors.
+ readline_write_history(CONSOLE_HISTORY);
+ }
}
return $line;
} else {