From f8b0a45dd87492cbb5dbc6793b87f427c20050ba Mon Sep 17 00:00:00 2001 From: Letter Date: Sat, 19 Oct 2019 20:35:56 +0800 Subject: [PATCH] Update shell.c --- shell.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell.c b/shell.c index 9d75c96..ad220b8 100644 --- a/shell.c +++ b/shell.c @@ -457,6 +457,7 @@ static void shellClearLine(SHELL_TypeDef *shell) */ static void shellHistoryAdd(SHELL_TypeDef *shell) { + shell->historyOffset = 0; if (strcmp(shell->history[shell->historyFlag - 1], shell->buffer) == 0) { return; @@ -473,7 +474,6 @@ static void shellHistoryAdd(SHELL_TypeDef *shell) { shell->historyFlag = 0; } - shell->historyOffset = 0; }