summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-12-27 11:37:31 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-12-27 11:37:31 +0000
commitdb907c209ffcbc20ce757c1d9e5a228f7501ec33 (patch)
treeaf3b36db77f16746ced953009f8f93566192c656 /src
parentc15769685c8cd409b3b3cc21ce43aeb15659141c (diff)
downloadirssi-db907c209ffcbc20ce757c1d9e5a228f7501ec33.zip
Don't add command to history if it's already in there as last entry. patch by peder.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2281 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r--src/fe-common/core/command-history.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/fe-common/core/command-history.c b/src/fe-common/core/command-history.c
index 18abd834..70f68594 100644
--- a/src/fe-common/core/command-history.c
+++ b/src/fe-common/core/command-history.c
@@ -41,6 +41,10 @@ void command_history_add(HISTORY_REC *history, const char *text)
g_return_if_fail(history != NULL);
g_return_if_fail(text != NULL);
+ link = g_list_last(history->list);
+ if (link != NULL && strcmp(link->data, text) == 0)
+ return; /* same as previous entry */
+
if (settings_get_int("max_command_history") < 1 ||
history->lines < settings_get_int("max_command_history"))
history->lines++;