1
0
mirror of https://github.com/NevermindZZT/letter-shell.git synced 2025-01-21 10:02:54 +08:00

Update shell.c

This commit is contained in:
Letter 2019-10-19 20:35:56 +08:00
parent 85d200ca1a
commit f8b0a45dd8

View File

@ -457,6 +457,7 @@ static void shellClearLine(SHELL_TypeDef *shell)
*/ */
static void shellHistoryAdd(SHELL_TypeDef *shell) static void shellHistoryAdd(SHELL_TypeDef *shell)
{ {
shell->historyOffset = 0;
if (strcmp(shell->history[shell->historyFlag - 1], shell->buffer) == 0) if (strcmp(shell->history[shell->historyFlag - 1], shell->buffer) == 0)
{ {
return; return;
@ -473,7 +474,6 @@ static void shellHistoryAdd(SHELL_TypeDef *shell)
{ {
shell->historyFlag = 0; shell->historyFlag = 0;
} }
shell->historyOffset = 0;
} }