Module Name:    src
Committed By:   christos
Date:           Wed Oct 21 21:45:30 UTC 2015

Modified Files:
        src/lib/libedit: vi.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/lib/libedit/vi.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libedit/vi.c
diff -u src/lib/libedit/vi.c:1.46 src/lib/libedit/vi.c:1.47
--- src/lib/libedit/vi.c:1.46	Sun Oct 18 20:36:27 2015
+++ src/lib/libedit/vi.c	Wed Oct 21 17:45:30 2015
@@ -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 @@ vi_histedit(EditLine *el, Int c __attrib
 		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;

Reply via email to