]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
quick fix to console.php: don't save blank lines into readline history
authorBrion Vibber <brion@pobox.com>
Mon, 25 Jan 2010 17:41:40 +0000 (09:41 -0800)
committerBrion Vibber <brion@pobox.com>
Mon, 25 Jan 2010 17:41:40 +0000 (09:41 -0800)
scripts/console.php

index 8b62a3a96783d7a7442326f33007d4f859e8d4f3..4d207c261b5a7da9f52799107dd04805e0240520 100755 (executable)
@@ -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 {