From 1e882d2791e2ee013954d7dc8ec6cfcec0cc2a79 Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Sun, 15 Sep 1996 19:35:23 +0000 Subject: [PATCH] Fix something that has annoyed me since day one of userconfig: when the prompt receives a 'q', just abandon the list, the user wants out. --- sys/i386/i386/userconfig.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/sys/i386/i386/userconfig.c b/sys/i386/i386/userconfig.c index 35321565ad5c..d1883da3884e 100644 --- a/sys/i386/i386/userconfig.c +++ b/sys/i386/i386/userconfig.c @@ -46,7 +46,7 @@ ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ** - ** $Id: userconfig.c,v 1.44 1996/09/11 19:53:45 phk Exp $ + ** $Id: userconfig.c,v 1.45 1996/09/13 06:48:21 bde Exp $ **/ /** @@ -119,13 +119,14 @@ static struct isa_device *isa_devlist; /* list read by dset to extract changes */ +#define putchar(x) cnputc(x) +#define getchar() cngetc() + #ifdef VISUAL_USERCONFIG static struct isa_device *devtabs[] = { isa_devtab_bio, isa_devtab_tty, isa_devtab_net, isa_devtab_null, NULL }; -#define putchar(x) cnputc(x) -#define getchar() cngetc() #ifndef FALSE @@ -2153,7 +2154,7 @@ visuserconfig(void) * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: userconfig.c,v 1.44 1996/09/11 19:53:45 phk Exp $ + * $Id: userconfig.c,v 1.45 1996/09/13 06:48:21 bde Exp $ */ #include "scbus.h" @@ -2496,7 +2497,10 @@ lsdevtab(struct isa_device *dt) if (lineno >= 23) { printf(" "); - (void)cngetc(); + if (getchar() == 'q') { + printf("quit\n"); + return; + } printf("\n"); lineno = 0; } @@ -2566,7 +2570,7 @@ cngets(char *input, int maxin) int c, nchars = 0; while (1) { - c = cngetc(); + c = getchar(); /* Treat ^H or ^? as backspace */ if ((c == '\010' || c == '\177')) { if (nchars) {