server: Fix detection of duplicate console history lines.

Sebastian Lackner sebastian at fds-team.de
Wed Apr 27 21:23:26 CDT 2016


Signed-off-by: Sebastian Lackner <sebastian at fds-team.de>
---

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



More information about the wine-patches mailing list