summaryrefslogtreecommitdiff
path: root/components/finsh/shell.c
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2017-11-01 13:44:56 +0800
committerGitHub <[email protected]>2017-11-01 13:44:56 +0800
commit832d8b4e0438fe04fb330093079d71ff2b556cab (patch)
tree3e9494f800b07f86663f2c9ee9ccb8a2a86ca0c2 /components/finsh/shell.c
parent85b17e9158af6e4a419d57099fe3752295451aa5 (diff)
parent82b7ecda065914f3f46183b19ed1acfbb7f654c9 (diff)
Merge pull request #927 from armink/fix_shell
[Finsh] Fix an auto complete history bug.
Diffstat (limited to 'components/finsh/shell.c')
-rw-r--r--components/finsh/shell.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/components/finsh/shell.c b/components/finsh/shell.c
index 4c20b3c640..90792e0039 100644
--- a/components/finsh/shell.c
+++ b/components/finsh/shell.c
@@ -372,7 +372,7 @@ static void shell_push_history(struct finsh_shell *shell)
if (shell->history_count >= FINSH_HISTORY_LINES)
{
/* if current cmd is same as last cmd, don't push */
- if (memcmp(&shell->cmd_history[FINSH_HISTORY_LINES - 1], shell->line, shell->line_position))
+ if (memcmp(&shell->cmd_history[FINSH_HISTORY_LINES - 1], shell->line, FINSH_CMD_SIZE))
{
/* move history */
int index;
@@ -391,7 +391,7 @@ static void shell_push_history(struct finsh_shell *shell)
else
{
/* if current cmd is same as last cmd, don't push */
- if (shell->history_count == 0 || memcmp(&shell->cmd_history[shell->history_count - 1], shell->line, shell->line_position))
+ if (shell->history_count == 0 || memcmp(&shell->cmd_history[shell->history_count - 1], shell->line, FINSH_CMD_SIZE))
{
shell->current_history = shell->history_count;
memset(&shell->cmd_history[shell->history_count][0], 0, FINSH_CMD_SIZE);