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

[incubator-nuttx-apps] branch master updated: system/readline: check the control ascii only to support multi-languages

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

jerpelea 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 54bbfee  system/readline: check the control ascii only to support multi-languages
54bbfee is described below

commit 54bbfee30e92f7aa8fa7b241e4c7c444087111f0
Author: chao.an <an...@xiaomi.com>
AuthorDate: Mon Jan 4 17:21:48 2021 +0800

    system/readline: check the control ascii only to support multi-languages
    
    Signed-off-by: chao.an <an...@xiaomi.com>
---
 system/readline/readline_common.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/system/readline/readline_common.c b/system/readline/readline_common.c
index 13750fe..413767a 100644
--- a/system/readline/readline_common.c
+++ b/system/readline/readline_common.c
@@ -733,11 +733,11 @@ ssize_t readline_common(FAR struct rl_common_s *vtbl, FAR char *buf,
           return nch;
         }
 
-      /* Otherwise, check if the character is printable and, if so, put the
-       * character in the line buffer
+      /* Otherwise, put the character in the line buffer if the
+       * character is not a control byte
        */
 
-      else if (isprint(ch))
+      else if (!iscntrl(ch & 0xff))
         {
           buf[nch++] = ch;