diff options
Diffstat (limited to 'cmd-line-utils/libedit/terminal.c')
-rw-r--r-- | cmd-line-utils/libedit/terminal.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/cmd-line-utils/libedit/terminal.c b/cmd-line-utils/libedit/terminal.c index fb5600a4140..18b789a8bea 100644 --- a/cmd-line-utils/libedit/terminal.c +++ b/cmd-line-utils/libedit/terminal.c @@ -1,7 +1,7 @@ /* $NetBSD: terminal.c,v 1.10 2011/10/04 15:27:04 christos Exp $ */ /*- - * Copyright (c) 1992, 1993 + * Copyright (c) 1992, 2015 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by @@ -1271,14 +1271,19 @@ terminal__flush(EditLine *el) /* terminal_writec(): * Write the given character out, in a human readable form */ -protected void +protected int terminal_writec(EditLine *el, Int c) { Char visbuf[VISUAL_WIDTH_MAX +1]; ssize_t vcnt = ct_visual_char(visbuf, VISUAL_WIDTH_MAX, c); - visbuf[vcnt] = '\0'; - terminal_overwrite(el, visbuf, (size_t)vcnt); - terminal__flush(el); + if(vcnt == -1) + return 1; /* Error due to insufficient space */ + else { + visbuf[vcnt] = '\0'; + terminal_overwrite(el, visbuf, (size_t)vcnt); + terminal__flush(el); + return 0; + } } |