mirror of
https://github.com/tio/tio.git
synced 2026-05-01 14:57:59 +02:00
Fix duplicate line checking bug in readline processing
This commit is contained in:
parent
e3b8724479
commit
035b661bb8
1 changed files with 3 additions and 1 deletions
|
|
@ -140,7 +140,9 @@ static void readline_input_cr(readline_t *rl)
|
||||||
{
|
{
|
||||||
// Different line only
|
// Different line only
|
||||||
if (rl->history_count == 0 ||
|
if (rl->history_count == 0 ||
|
||||||
(rl->history_count > 0 && strncmp(rl->history[rl->history_count - 1], rl->line, rl->line_length) != 0))
|
(rl->history_count > 0 &&
|
||||||
|
! (rl->history[rl->history_count - 1][rl->line_length] == '\0' &&
|
||||||
|
strncmp(rl->history[rl->history_count - 1], rl->line, rl->line_length) == 0)) )
|
||||||
{
|
{
|
||||||
// Save to history
|
// Save to history
|
||||||
if (rl->history_count < RL_HISTORY_MAX)
|
if (rl->history_count < RL_HISTORY_MAX)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue