* [PATCH] cli_readline: Only insert printable chars
@ 2020-11-22 4:58 Steve Bennett
2021-01-18 13:00 ` Tom Rini
0 siblings, 1 reply; 2+ messages in thread
From: Steve Bennett @ 2020-11-22 4:58 UTC (permalink / raw)
To: u-boot
There should be no need to insert non-printable characters
and this prevents line editing getting confused.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
---
common/cli_readline.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/common/cli_readline.c b/common/cli_readline.c
index 47b876285c..5c158d03b4 100644
--- a/common/cli_readline.c
+++ b/common/cli_readline.c
@@ -493,8 +493,10 @@ static int cread_line(const char *const prompt, char *buf, unsigned int *len,
}
#endif
default:
- cread_add_char(ichar, insert, &num, &eol_num, buf,
- *len);
+ if (ichar >= ' ' && ichar <= '~') {
+ cread_add_char(ichar, insert, &num, &eol_num,
+ buf, *len);
+ }
break;
}
}
--
2.24.2 (Apple Git-127)
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-01-18 13:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-22 4:58 [PATCH] cli_readline: Only insert printable chars Steve Bennett
2021-01-18 13:00 ` Tom Rini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.