summaryrefslogtreecommitdiffstats
path: root/src/search.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2005-08-15 21:41:48 +0000
committerBram Moolenaar <Bram@vim.org>2005-08-15 21:41:48 +0000
commitae5bce1c127136a650ee25c4c78d3d334cc07859 (patch)
tree992edb0baaa4a6a4156fbfb77d4f6382cd3f5999 /src/search.c
parent90cfdbe040320952e6b542d0633987f082b0f158 (diff)
updated for version 7.0130v7.0130
Diffstat (limited to 'src/search.c')
-rw-r--r--src/search.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/search.c b/src/search.c
index bc5da67bb3..af3215b318 100644
--- a/src/search.c
+++ b/src/search.c
@@ -544,8 +544,13 @@ searchit(win, buf, pos, dir, pat, count, options, pat_use)
/* Watch out for the "col" being MAXCOL - 2, used in a closed fold. */
else if (has_mbyte && pos->lnum >= 1 && pos->lnum <= buf->b_ml.ml_line_count
&& pos->col < MAXCOL - 2)
- extra_col = (*mb_ptr2len)(ml_get_buf(buf, pos->lnum, FALSE)
- + pos->col);
+ {
+ ptr = ml_get_buf(buf, pos->lnum, FALSE) + pos->col;
+ if (*ptr == NUL)
+ extra_col = 1;
+ else
+ extra_col = (*mb_ptr2len)(ptr);
+ }
#endif
else
extra_col = 1;