From 448a3dac084bf33ff467170a8990c16eff8be3ab Mon Sep 17 00:00:00 2001 From: Abit Date: Fri, 3 May 2019 16:54:25 +0200 Subject: [PATCH] Avoid continuously duplicate commands in history When adding a command to history, if CONFIG_UNIQUE_HISTORY is defined, always compare current command with the last entry in history. --- src/editline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/editline.c b/src/editline.c index 914389d..c1a1c5e 100644 --- a/src/editline.c +++ b/src/editline.c @@ -1130,7 +1130,7 @@ static void hist_add(const char *p) char *s; #ifdef CONFIG_UNIQUE_HISTORY - if (H.Pos && strcmp(p, H.Lines[H.Pos - 1]) == 0) + if (H.Size && strcmp(p, H.Lines[H.Size - 1]) == 0) return; #endif