Enable the use of ^C and ^S/^Q in DDB.

This lets one interrupt DDB's output, which is useful if paging is
disabled and the output device is slow.

Submitted by:	Anton Rang <rang@acm.org>
Reviewed by:	jhb
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D9138
This commit is contained in:
Mark Johnston 2017-01-12 00:22:36 +00:00
parent 8a2ec16a9d
commit 5fddef7999

View File

@ -63,7 +63,6 @@ static int db_lhist_nlines;
#define BLANK ' '
#define BACKUP '\b'
static int cnmaygetc(void);
static void db_delete(int n, int bwd);
static int db_inputchar(int c);
static void db_putnchars(int c, int count);
@ -291,12 +290,6 @@ db_inputchar(c)
return (0);
}
static int
cnmaygetc()
{
return (-1);
}
int
db_readline(lstart, lsize)
char * lstart;
@ -350,7 +343,7 @@ db_check_interrupt(void)
{
int c;
c = cnmaygetc();
c = cncheckc();
switch (c) {
case -1: /* no character */
return;
@ -361,7 +354,7 @@ db_check_interrupt(void)
case CTRL('s'):
do {
c = cnmaygetc();
c = cncheckc();
if (c == CTRL('c'))
db_error((char *)0);
} while (c != CTRL('q'));