readline: Reset offset when top command is issued repeateadly

This commit is contained in:
Gustavo Henrique Nihei 2021-05-24 19:05:21 -03:00 committed by Xiang Xiao
parent 82ed7bf5b1
commit b843486386

View File

@ -708,13 +708,14 @@ ssize_t readline_common(FAR struct rl_common_s *vtbl, FAR char *buf,
}
g_cmdhist.buf[g_cmdhist.head][i] = '\0';
g_cmdhist.offset = 1;
if (g_cmdhist.len < RL_CMDHIST_LEN)
{
g_cmdhist.len++;
}
}
g_cmdhist.offset = 1;
}
#endif /* CONFIG_READLINE_CMD_HISTORY */