summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2010-03-10 14:46:26 +0100
committerBram Moolenaar <Bram@vim.org>2010-03-10 14:46:26 +0100
commit37d619f896bb425a0e82199977ab9069434c9b1d (patch)
tree55436a1d7087827e0728afe130fc717fc44dc69c
parentbe678f86d13a4c613daf74192f177590bc45c2c4 (diff)
updated for version 7.2.391v7.2.391
Problem: Internal alloc(0) error when doing "CTRL-V $ c". (Martti Kuparinen) Solution: Fix computations in getvcol(). (partly by Lech Lorens)
-rw-r--r--src/charset.c9
-rw-r--r--src/memline.c12
-rw-r--r--src/version.c2
3 files changed, 14 insertions, 9 deletions
diff --git a/src/charset.c b/src/charset.c
index 5b0e71c8a4..ef162e4a47 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -1255,7 +1255,10 @@ getvcol(wp, pos, start, cursor, end)
vcol = 0;
ptr = ml_get_buf(wp->w_buffer, pos->lnum, FALSE);
- posptr = ptr + pos->col;
+ if (pos->col == MAXCOL)
+ posptr = NULL; /* continue until the NUL */
+ else
+ posptr = ptr + pos->col;
/*
* This function is used very often, do some speed optimizations.
@@ -1313,7 +1316,7 @@ getvcol(wp, pos, start, cursor, end)
incr = CHARSIZE(c);
}
- if (ptr >= posptr) /* character at pos->col */
+ if (posptr != NULL && ptr >= posptr) /* character at pos->col */
break;
vcol += incr;
@@ -1334,7 +1337,7 @@ getvcol(wp, pos, start, cursor, end)
break;
}
- if (ptr >= posptr) /* character at pos->col */
+ if (posptr != NULL && ptr >= posptr) /* character at pos->col */
break;
vcol += incr;
diff --git a/src/memline.c b/src/memline.c
index 29a6e5cca3..102b61e31a 100644
--- a/src/memline.c
+++ b/src/memline.c
@@ -2113,12 +2113,12 @@ errorret:
if (buf->b_ml.ml_mfp == NULL) /* there are no lines */
return (char_u *)"";
-/*
- * See if it is the same line as requested last time.
- * Otherwise may need to flush last used line.
- * Don't use the last used line when 'swapfile' is reset, need to load all
- * blocks.
- */
+ /*
+ * See if it is the same line as requested last time.
+ * Otherwise may need to flush last used line.
+ * Don't use the last used line when 'swapfile' is reset, need to load all
+ * blocks.
+ */
if (buf->b_ml.ml_line_lnum != lnum || mf_dont_release)
{
ml_flush_line(buf);
diff --git a/src/version.c b/src/version.c
index 18f3ba5c4e..a635aad7ad 100644
--- a/src/version.c
+++ b/src/version.c
@@ -682,6 +682,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 391,
+/**/
390,
/**/
389,