From b1d647d695fe45362808262ca50b6014bde2008d Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Fri, 13 Feb 2015 20:26:26 -0500 Subject: [PATCH] debugger - don't add history line if it's identical to previous line --- bin/debugger.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/debugger.cpp b/bin/debugger.cpp index f94e6cc..390164b 100644 --- a/bin/debugger.cpp +++ b/bin/debugger.cpp @@ -1307,8 +1307,10 @@ void Shell() } } - // todo -- don't add if same as previous command. - add_history(cp); + // don't add if same as previous entry. + HIST_ENTRY *he = current_history(); + if (he == nullptr || strcmp(he->line, cp) != 0) + add_history(cp); } free(cp); }