forked from GNUsocial/gnu-social
quick fix to console.php: don't save blank lines into readline history
This commit is contained in:
parent
055a00bcae
commit
ee4ca8f260
@ -45,11 +45,13 @@ function read_input_line($prompt)
|
|||||||
if (CONSOLE_INTERACTIVE) {
|
if (CONSOLE_INTERACTIVE) {
|
||||||
if (CONSOLE_READLINE) {
|
if (CONSOLE_READLINE) {
|
||||||
$line = readline($prompt);
|
$line = readline($prompt);
|
||||||
|
if (trim($line) != '') {
|
||||||
readline_add_history($line);
|
readline_add_history($line);
|
||||||
if (defined('CONSOLE_HISTORY')) {
|
if (defined('CONSOLE_HISTORY')) {
|
||||||
// Save often; it's easy to hit fatal errors.
|
// Save often; it's easy to hit fatal errors.
|
||||||
readline_write_history(CONSOLE_HISTORY);
|
readline_write_history(CONSOLE_HISTORY);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return $line;
|
return $line;
|
||||||
} else {
|
} else {
|
||||||
return readline_emulation($prompt);
|
return readline_emulation($prompt);
|
||||||
|
Loading…
Reference in New Issue
Block a user