Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libedit Use the full buffer for the conversion; ideally ...



details:   https://anonhg.NetBSD.org/src/rev/ae7056821314
branches:  trunk
changeset: 811297:ae7056821314
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Oct 21 21:45:30 2015 +0000

description:
Use the full buffer for the conversion; ideally we should be dynamically
allocating this. From Jilles Tjoelker

diffstat:

 lib/libedit/vi.c |  7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diffs (28 lines):

diff -r f1e8f9b55089 -r ae7056821314 lib/libedit/vi.c
--- a/lib/libedit/vi.c  Wed Oct 21 21:43:46 2015 +0000
+++ b/lib/libedit/vi.c  Wed Oct 21 21:45:30 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vi.c,v 1.46 2015/10/19 00:36:27 christos Exp $ */
+/*     $NetBSD: vi.c,v 1.47 2015/10/21 21:45:30 christos Exp $ */
 
 /*-
  * Copyright (c) 1992, 1993
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = "@(#)vi.c       8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: vi.c,v 1.46 2015/10/19 00:36:27 christos Exp $");
+__RCSID("$NetBSD: vi.c,v 1.47 2015/10/21 21:45:30 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -1041,8 +1041,7 @@
                st = read(fd, cp, TMP_BUFSIZ - 1);
                if (st > 0) {
                        cp[st] = '\0';
-                       len = (size_t)(el->el_line.lastchar -
-                           el->el_line.buffer);
+                       len = (size_t)(el->el_line.limit - el->el_line.buffer);
                        len = ct_mbstowcs(el->el_line.buffer, cp, len);
                        if (len > 0 && el->el_line.buffer[len - 1] == '\n')
                                --len;



Home | Main Index | Thread Index | Old Index