You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2021/05/25 03:02:22 UTC

[incubator-nuttx-apps] branch master updated: readline: Reset offset when top command is issued repeateadly

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
     new b843486  readline: Reset offset when top command is issued repeateadly
b843486 is described below

commit b843486386424c01c63438fea8e6efe3b110458e
Author: Gustavo Henrique Nihei <gu...@espressif.com>
AuthorDate: Mon May 24 19:05:21 2021 -0300

    readline: Reset offset when top command is issued repeateadly
---
 system/readline/readline_common.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/system/readline/readline_common.c b/system/readline/readline_common.c
index 413767a..d8c27de 100644
--- a/system/readline/readline_common.c
+++ b/system/readline/readline_common.c
@@ -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 */