From db907c209ffcbc20ce757c1d9e5a228f7501ec33 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Thu, 27 Dec 2001 11:37:31 +0000 Subject: [PATCH] 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 --- src/fe-common/core/command-history.c | 4 ++++ 1 file changed, 4 insertions(+) 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++;