Skip to content
This repository was archived by the owner on Oct 5, 2021. It is now read-only.

Commit 571033e

Browse files
author
Arun Kuruvila
committed
Merge branch 'mysql-5.5' into mysql-5.6
2 parents af33406 + dbe6832 commit 571033e

File tree

4 files changed

+22
-13
lines changed

4 files changed

+22
-13
lines changed

cmd-line-utils/libedit/el_terminal.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* $NetBSD: terminal.h,v 1.3 2011/07/29 23:44:45 christos Exp $ */
22

33
/*-
4-
* Copyright (c) 1992, 1993
4+
* Copyright (c) 1992, 2015
55
* The Regents of the University of California. All rights reserved.
66
*
77
* This code is derived from software contributed to Berkeley by
@@ -103,7 +103,7 @@ protected int terminal_settc(EditLine *, int, const Char **);
103103
protected int terminal_gettc(EditLine *, int, char **);
104104
protected int terminal_telltc(EditLine *, int, const Char **);
105105
protected int terminal_echotc(EditLine *, int, const Char **);
106-
protected void terminal_writec(EditLine *, Int);
106+
protected int terminal_writec(EditLine *, Int);
107107
protected int terminal__putc(EditLine *, Int);
108108
protected void terminal__flush(EditLine *);
109109

cmd-line-utils/libedit/emacs.c

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* $NetBSD: emacs.c,v 1.25 2011/07/29 15:16:33 christos Exp $ */
22

33
/*-
4-
* Copyright (c) 1992, 1993
4+
* Copyright (c) 1992, 2015
55
* The Regents of the University of California. All rights reserved.
66
*
77
* This code is derived from software contributed to Berkeley by
@@ -58,8 +58,10 @@ em_delete_or_list(EditLine *el, Int c)
5858
/* if I'm at the end */
5959
if (el->el_line.cursor == el->el_line.buffer) {
6060
/* and the beginning */
61-
terminal_writec(el, c); /* then do an EOF */
62-
return CC_EOF;
61+
if(!(terminal_writec(el, c))) /* then do an EOF */
62+
return CC_EOF;
63+
else
64+
return CC_ERROR;
6365
} else {
6466
/*
6567
* Here we could list completions, but it is an

cmd-line-utils/libedit/terminal.c

+10-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* $NetBSD: terminal.c,v 1.10 2011/10/04 15:27:04 christos Exp $ */
22

33
/*-
4-
* Copyright (c) 1992, 1993
4+
* Copyright (c) 1992, 2015
55
* The Regents of the University of California. All rights reserved.
66
*
77
* This code is derived from software contributed to Berkeley by
@@ -1271,14 +1271,19 @@ terminal__flush(EditLine *el)
12711271
/* terminal_writec():
12721272
* Write the given character out, in a human readable form
12731273
*/
1274-
protected void
1274+
protected int
12751275
terminal_writec(EditLine *el, Int c)
12761276
{
12771277
Char visbuf[VISUAL_WIDTH_MAX +1];
12781278
ssize_t vcnt = ct_visual_char(visbuf, VISUAL_WIDTH_MAX, c);
1279-
visbuf[vcnt] = '\0';
1280-
terminal_overwrite(el, visbuf, (size_t)vcnt);
1281-
terminal__flush(el);
1279+
if(vcnt == -1)
1280+
return 1; /* Error due to insufficient space */
1281+
else {
1282+
visbuf[vcnt] = '\0';
1283+
terminal_overwrite(el, visbuf, (size_t)vcnt);
1284+
terminal__flush(el);
1285+
return 0;
1286+
}
12821287
}
12831288

12841289

cmd-line-utils/libedit/vi.c

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* $NetBSD: vi.c,v 1.41 2011/10/04 15:27:04 christos Exp $ */
22

33
/*-
4-
* Copyright (c) 1992, 1993
4+
* Copyright (c) 1992, 2015
55
* The Regents of the University of California. All rights reserved.
66
*
77
* This code is derived from software contributed to Berkeley by
@@ -607,8 +607,10 @@ vi_list_or_eof(EditLine *el, Int c)
607607

608608
if (el->el_line.cursor == el->el_line.lastchar) {
609609
if (el->el_line.cursor == el->el_line.buffer) {
610-
terminal_writec(el, c); /* then do a EOF */
611-
return CC_EOF;
610+
if(!(terminal_writec(el, c))) /* then do a EOF */
611+
return CC_EOF;
612+
else
613+
return CC_ERROR;
612614
} else {
613615
/*
614616
* Here we could list completions, but it is an

0 commit comments

Comments
 (0)