diff --git a/Changes b/Changes index bfbffaa..b91e949 100644 --- a/Changes +++ b/Changes @@ -15,6 +15,8 @@ Release ... IM (insert mode) capability. It is unlikely that such terminals actually exist, but vi will use the corresponding code for open mode if a termcap entry is not available. +* When an illegal multibyte sequence is entered in vi insert mode, no garbage + bytes are generated anymore when the insert mode is left. * The '\u', '\l', '\U', and '\L' substitution sequences work with multibyte characters now. * Handle character case conversions with the '~' vi command correctly if the diff --git a/ex_version.c b/ex_version.c index 07e62d7..80d3422 100644 --- a/ex_version.c +++ b/ex_version.c @@ -70,7 +70,7 @@ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * Sccsid @(#)ex_version.c 1.113 (gritter) 1/12/05 + * Sccsid @(#)ex_version.c 1.114 (gritter) 1/12/05 */ #include "ex.h" diff --git a/ex_vops2.c b/ex_vops2.c index f129a03..d7cd3fb 100644 --- a/ex_vops2.c +++ b/ex_vops2.c @@ -73,7 +73,7 @@ #ifndef lint #ifdef DOSCCS -static char sccsid[] = "@(#)ex_vops2.c 1.33 (gritter) 11/29/04"; +static char sccsid[] = "@(#)ex_vops2.c 1.34 (gritter) 1/12/05"; #endif #endif @@ -577,7 +577,7 @@ xgappend(int c, char **gp) return; } #ifdef MB - if (mb_cur_max > 1) { + if (mb_cur_max > 1 && !(c & INVBIT)) { char mb[MB_LEN_MAX]; int i, n; n = wctomb(mb, c); @@ -585,7 +585,7 @@ xgappend(int c, char **gp) *(*gp)++ = mb[i]; } else #endif /* MB */ - *(*gp)++ = c; + *(*gp)++ = c & 0377; } /*