summaryrefslogtreecommitdiff
path: root/Libraries/LibLine
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2020-05-25 23:45:01 +0100
committerAndreas Kling <kling@serenityos.org>2020-05-26 00:50:49 +0200
commit4e607192c73d49e6fdb0c9aa5e8c6aff35ecf3c9 (patch)
tree565ed9761b9ec0bd944ac5cd35f013350e6b35f0 /Libraries/LibLine
parent67b742bf3218ced0cc0471ae8615beed66fe2cd3 (diff)
downloadserenity-4e607192c73d49e6fdb0c9aa5e8c6aff35ecf3c9.zip
LibLine: Don't add empty lines to history
Diffstat (limited to 'Libraries/LibLine')
-rw-r--r--Libraries/LibLine/Editor.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/Libraries/LibLine/Editor.cpp b/Libraries/LibLine/Editor.cpp
index 97010c4c12..bb11476717 100644
--- a/Libraries/LibLine/Editor.cpp
+++ b/Libraries/LibLine/Editor.cpp
@@ -63,6 +63,8 @@ Editor::~Editor()
void Editor::add_to_history(const String& line)
{
+ if (line.is_empty())
+ return;
if ((m_history.size() + 1) > m_history_capacity)
m_history.take_first();
m_history.append(line);