未验证 提交 cd4f6c9a 编写于 作者: wafwerar's avatar wafwerar 提交者: GitHub

Merge pull request #15337 from taosdata/fix/ZhiqiangWang/TD-13063-fix-shell-history-error

shell: fix shell history error
......@@ -524,10 +524,8 @@ int32_t shellReadCommand(char *command) {
c = taosGetConsoleChar();
switch (c) {
case 'A': // Up arrow
if (hist_counter != pHistory->hstart) {
hist_counter = (hist_counter + SHELL_MAX_HISTORY_SIZE - 1) % SHELL_MAX_HISTORY_SIZE;
shellResetCommand(&cmd, (pHistory->hist[hist_counter] == NULL) ? "" : pHistory->hist[hist_counter]);
}
hist_counter = (hist_counter + SHELL_MAX_HISTORY_SIZE - 1) % SHELL_MAX_HISTORY_SIZE;
shellResetCommand(&cmd, (pHistory->hist[hist_counter] == NULL) ? "" : pHistory->hist[hist_counter]);
break;
case 'B': // Down arrow
if (hist_counter != pHistory->hend) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册