From: Sebastian Lackner Subject: server: Fix detection of duplicate console history lines. Message-Id: Date: Thu, 28 Apr 2016 04:23:26 +0200 Signed-off-by: Sebastian Lackner --- To reproduce this issue, open a console and enable the "Remove duplicates" switch. Then enter "echo xyz" and "echo x" - the second command is not added to the history. server/console.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/console.c b/server/console.c index efb20da..89c4cf0 100644 --- a/server/console.c +++ b/server/console.c @@ -1055,7 +1055,7 @@ static void console_input_append_hist( struct console_input* console, const WCHA ptr[len] = 0; if (console->history_mode && console->history_index && - strncmpW( console->history[console->history_index - 1], ptr, len ) == 0) + !memcmp( console->history[console->history_index - 1], ptr, (len + 1) * sizeof(WCHAR) )) { /* ok, mode ask us to not use twice the same string... * so just free mem and returns -- 2.8.0