]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
libedit: Use correct buffer lengths in vi mode v command.
authorjilles <jilles@FreeBSD.org>
Tue, 27 Oct 2015 21:16:29 +0000 (21:16 +0000)
committerjilles <jilles@FreeBSD.org>
Tue, 27 Oct 2015 21:16:29 +0000 (21:16 +0000)
commit2de62537c02c0b57a9fcbbd29b2b9ceb62bb84d5
tree88715f4dc46e9a2bbb22c3f95e213b7aa1b3a3a4
parente984b742addf983b5812d19b93b8e0c7b7d4810a
libedit: Use correct buffer lengths in vi mode v command.

Libedit's vi mode provides a v command to edit the current line in vi(1)
(hard-coded to vi, in fact).

When Unicode/wide character mode was added, this command started truncating
and/or corrupting the edited text.

This commit fixes v if the text fits into the buffer. If the text is longer,
it is truncated.

PR: 203743
Obtained from: NetBSD (originally submitted by me)
lib/libedit/vi.c