You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ac...@apache.org on 2020/02/04 22:07:44 UTC

[incubator-nuttx-apps] 05/06: Send "NVT"(network virtual terminal) as the default if getenv("TERM") return NULL

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

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

commit 7a32777d4d5d5d57f24f850a545c4d02b5b4ec85
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Tue Feb 4 18:31:04 2020 +0800

    Send "NVT"(network virtual terminal) as the default if getenv("TERM") return NULL
    
    Change-Id: I89591ac76ae77a9f670f373897d7e8416c5a7d58
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 netutils/telnetc/telnetc.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/netutils/telnetc/telnetc.c b/netutils/telnetc/telnetc.c
index 09475f1..a95c659 100644
--- a/netutils/telnetc/telnetc.c
+++ b/netutils/telnetc/telnetc.c
@@ -2279,6 +2279,11 @@ void telnet_ttype_is(struct telnet_s *telnet, const char *ttype)
     TELNET_IAC, TELNET_SB, TELNET_TELOPT_TTYPE, TELNET_TTYPE_IS
   };
 
+  if (!ttype)
+    {
+      ttype = "NVT";
+    }
+
   _sendu(telnet, IS, sizeof(IS));
   _send(telnet, ttype, strlen(ttype));
   telnet_finish_sb(telnet);