diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-02-21 13:17:13 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-02-21 13:17:13 +0000 |
commit | 3dbc5c543ab0fd4d97db082db102e1ac8c70269f (patch) | |
tree | 18944c49c2ad0c2c76660ea79d319097e7bfc3aa /sys/stand | |
parent | 945c92f9a35d4530d23893989074a2da7c5fb76b (diff) |
hand-cruft an isprint() for deciding which characters to echo to the
console; ignore all others. based on idea by didickman@gmail.com,
ok tom
Diffstat (limited to 'sys/stand')
-rw-r--r-- | sys/stand/boot/cmd.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/stand/boot/cmd.c b/sys/stand/boot/cmd.c index 6395d4d42b5..1d91e5d74c7 100644 --- a/sys/stand/boot/cmd.c +++ b/sys/stand/boot/cmd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd.c,v 1.57 2004/06/26 17:50:47 tom Exp $ */ +/* $OpenBSD: cmd.c,v 1.58 2007/02/21 13:17:12 deraadt Exp $ */ /* * Copyright (c) 1997-1999 Michael Shalayeff @@ -291,11 +291,13 @@ readline(char *buf, size_t n, int to) } continue; default: - if (p - buf < n-1) - *p++ = ch; - else { - putchar('\007'); - putchar('\177'); + if (ch >= ' ' && ch < '\177') { + if (p - buf < n-1) + *p++ = ch; + else { + putchar('\007'); + putchar('\177'); + } } continue; } |