diff options
-rw-r--r-- | lib/libedit/Makefile | 4 | ||||
-rw-r--r-- | lib/libedit/read.c | 73 |
2 files changed, 5 insertions, 72 deletions
diff --git a/lib/libedit/Makefile b/lib/libedit/Makefile index b2c784a4e9b..8915073db53 100644 --- a/lib/libedit/Makefile +++ b/lib/libedit/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.25 2016/05/10 11:53:54 schwarze Exp $ +# $OpenBSD: Makefile,v 1.26 2016/05/24 18:06:30 schwarze Exp $ # $NetBSD: Makefile,v 1.41 2010/02/03 15:34:43 roy Exp $ # @(#)Makefile 8.1 (Berkeley) 6/4/93 @@ -22,7 +22,7 @@ CLEANFILES+=help.h.tmp vi.h.tmp tc1.o tc1 .depend CFLAGS+=-Wall CPPFLAGS+=-I. -I${LIBEDITDIR} CPPFLAGS+=-I. -I${.CURDIR} -#CPPFLAGS+=-DDEBUG_TTY -DDEBUG_KEY -DDEBUG_READ -DDEBUG -DDEBUG_REFRESH +#CPPFLAGS+=-DDEBUG_TTY -DDEBUG_KEY -DDEBUG -DDEBUG_REFRESH #CPPFLAGS+=-DDEBUG_PASTE -DDEBUG_EDIT AHDR=vi.h emacs.h common.h diff --git a/lib/libedit/read.c b/lib/libedit/read.c index 9b3805fae57..d26760010be 100644 --- a/lib/libedit/read.c +++ b/lib/libedit/read.c @@ -1,4 +1,4 @@ -/* $OpenBSD: read.c,v 1.41 2016/05/22 23:09:56 schwarze Exp $ */ +/* $OpenBSD: read.c,v 1.42 2016/05/24 18:06:30 schwarze Exp $ */ /* $NetBSD: read.c,v 1.97 2016/05/22 19:44:26 christos Exp $ */ /*- @@ -130,25 +130,6 @@ el_read_getfn(struct el_read_t *el_read) } -#ifdef DEBUG_EDIT -static void -read_debug(EditLine *el) -{ - - if (el->el_line.cursor > el->el_line.lastchar) - (void) fprintf(el->el_errfile, "cursor > lastchar\r\n"); - if (el->el_line.cursor < el->el_line.buffer) - (void) fprintf(el->el_errfile, "cursor < buffer\r\n"); - if (el->el_line.cursor > el->el_line.limit) - (void) fprintf(el->el_errfile, "cursor > limit\r\n"); - if (el->el_line.lastchar > el->el_line.limit) - (void) fprintf(el->el_errfile, "lastchar > limit\r\n"); - if (el->el_line.limit != &el->el_line.buffer[EL_BUFSIZ - 2]) - (void) fprintf(el->el_errfile, "limit != &buffer[EL_BUFSIZ-2]\r\n"); -} -#endif /* DEBUG_EDIT */ - - /* read__fixio(): * Try to recover from a read error */ @@ -422,21 +403,12 @@ el_wgetc(EditLine *el, wchar_t *cp) return 1; } -#ifdef DEBUG_READ - (void) fprintf(el->el_errfile, "Turning raw mode on\n"); -#endif /* DEBUG_READ */ if (tty_rawmode(el) < 0)/* make sure the tty is set up correctly */ return 0; -#ifdef DEBUG_READ - (void) fprintf(el->el_errfile, "Reading a character\n"); -#endif /* DEBUG_READ */ num_read = (*el->el_read->read_char)(el, cp); if (num_read < 0) el->el_errno = errno; -#ifdef DEBUG_READ - (void) fprintf(el->el_errfile, "Got it %lc\n", *cp); -#endif /* DEBUG_READ */ return num_read; } @@ -569,45 +541,18 @@ el_wgets(EditLine *el, int *nread) } for (num = -1; num == -1;) { /* while still editing this line */ -#ifdef DEBUG_EDIT - read_debug(el); -#endif /* DEBUG_EDIT */ /* if EOF or error */ - if (read_getcmd(el, &cmdnum, &ch) == -1) { -#ifdef DEBUG_READ - (void) fprintf(el->el_errfile, - "Returning from el_gets\n"); -#endif /* DEBUG_READ */ + if (read_getcmd(el, &cmdnum, &ch) == -1) break; - } if (el->el_errno == EINTR) { el->el_line.buffer[0] = '\0'; el->el_line.lastchar = el->el_line.cursor = el->el_line.buffer; break; } - if ((unsigned int)cmdnum >= (unsigned int)el->el_map.nfunc) { /* BUG CHECK command */ -#ifdef DEBUG_EDIT - (void) fprintf(el->el_errfile, - "ERROR: illegal command from key 0%o\r\n", ch); -#endif /* DEBUG_EDIT */ + if ((int)cmdnum >= el->el_map.nfunc) /* BUG CHECK command */ continue; /* try again */ - } /* now do the real command */ -#ifdef DEBUG_READ - { - el_bindings_t *b; - for (b = el->el_map.help; b->name; b++) - if (b->func == cmdnum) - break; - if (b->name) - (void) fprintf(el->el_errfile, - "Executing %ls\n", b->name); - else - (void) fprintf(el->el_errfile, - "Error command = %d\n", cmdnum); - } -#endif /* DEBUG_READ */ /* vi redo needs these way down the levels... */ el->el_state.thiscmd = cmdnum; el->el_state.thisch = ch; @@ -622,10 +567,6 @@ el_wgets(EditLine *el, int *nread) *el->el_chared.c_redo.pos++ = ch; } retval = (*el->el_map.func[cmdnum]) (el, ch); -#ifdef DEBUG_READ - (void) fprintf(el->el_errfile, - "Returned state %d\n", retval ); -#endif /* DEBUG_READ */ /* save the last command here */ el->el_state.lastcmd = cmdnum; @@ -672,10 +613,6 @@ el_wgets(EditLine *el, int *nread) break; case CC_FATAL: /* fatal error, reset to known state */ -#ifdef DEBUG_READ - (void) fprintf(el->el_errfile, - "*** editor fatal ERROR ***\r\n\n"); -#endif /* DEBUG_READ */ /* put (real) cursor in a known place */ re_clear_display(el); /* reset the display stuff */ ch_reset(el); /* reset the input pointers */ @@ -685,10 +622,6 @@ el_wgets(EditLine *el, int *nread) case CC_ERROR: default: /* functions we don't know about */ -#ifdef DEBUG_READ - (void) fprintf(el->el_errfile, - "*** editor ERROR ***\r\n\n"); -#endif /* DEBUG_READ */ terminal_beep(el); terminal__flush(el); break; |