From: Brion Vibber Date: Mon, 25 Jan 2010 17:41:40 +0000 (-0800) Subject: quick fix to console.php: don't save blank lines into readline history X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ee4ca8f2601bc5a2dd258fea176037e03e23feb8;p=quix0rs-gnu-social.git quick fix to console.php: don't save blank lines into readline history --- diff --git a/scripts/console.php b/scripts/console.php index 8b62a3a967..4d207c261b 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 {