summaryrefslogtreecommitdiffstats
path: root/src/edit.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2012-06-01 15:21:02 +0200
committerBram Moolenaar <Bram@vim.org>2012-06-01 15:21:02 +0200
commit9a920d8c31bc4d267d8790ba0d83b5774316e08f (patch)
tree9e3efd2be89a848c17b76251486cf14da09c7e9b /src/edit.c
parent704984ac87979fd20b8ba732df3abd3197814f7f (diff)
updated for version 7.3.535v7.3.535
Problem: Many #ifdefs for MB_MAXBYTES. Solution: Also define MB_MAXBYTES without the +multi_byte feature. Fix places where the buffer didn't include space for a NUL byte.
Diffstat (limited to 'src/edit.c')
-rw-r--r--src/edit.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/src/edit.c b/src/edit.c
index 39985bdd57..ebecdb6ece 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -1648,11 +1648,7 @@ static int pc_status;
#define PC_STATUS_RIGHT 1 /* right halve of double-wide char */
#define PC_STATUS_LEFT 2 /* left halve of double-wide char */
#define PC_STATUS_SET 3 /* pc_bytes was filled */
-#ifdef FEAT_MBYTE
static char_u pc_bytes[MB_MAXBYTES + 1]; /* saved bytes */
-#else
-static char_u pc_bytes[2]; /* saved bytes */
-#endif
static int pc_attr;
static int pc_row;
static int pc_col;
@@ -6819,11 +6815,7 @@ set_last_insert(c)
char_u *s;
vim_free(last_insert);
-#ifdef FEAT_MBYTE
last_insert = alloc(MB_MAXBYTES * 3 + 5);
-#else
- last_insert = alloc(6);
-#endif
if (last_insert != NULL)
{
s = last_insert;
@@ -6861,7 +6853,7 @@ add_char2buf(c, s)
char_u *s;
{
#ifdef FEAT_MBYTE
- char_u temp[MB_MAXBYTES];
+ char_u temp[MB_MAXBYTES + 1];
int i;
int len;
@@ -7423,7 +7415,7 @@ mb_replace_pop_ins(cc)
int cc;
{
int n;
- char_u buf[MB_MAXBYTES];
+ char_u buf[MB_MAXBYTES + 1];
int i;
int c;
@@ -10109,11 +10101,7 @@ do_insert_char_pre(c)
int c;
{
char_u *res;
-#ifdef FEAT_MBYTE
char_u buf[MB_MAXBYTES + 1];
-#else
- char_u buf[2];
-#endif
/* Return quickly when there is nothing to do. */
if (!has_insertcharpre())