summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-01-24 20:47:50 +0100
committerBram Moolenaar <Bram@vim.org>2017-01-24 20:47:50 +0100
commit6a717f17ec6b09634be1c29e0ac4c35213f7b32d (patch)
treec6f88304ae5fb437f2fb2836f71a66041ab52147
parentb031c4ea04eb1e37a873fbb85e90d835aa1e2b1c (diff)
downloadvim-6a717f17ec6b09634be1c29e0ac4c35213f7b32d.zip
patch 8.0.0236: gcc complains about uninitialized variable
Problem: Gcc complains that a variable may be used uninitialized. Confusion between variable and label name. (John Marriott) Solution: Initialize it. Rename end to end_lnum.
-rw-r--r--src/ops.c10
-rw-r--r--src/version.c2
2 files changed, 7 insertions, 5 deletions
diff --git a/src/ops.c b/src/ops.c
index 2aee03def..7d656a631 100644
--- a/src/ops.c
+++ b/src/ops.c
@@ -3774,13 +3774,13 @@ do_put(
*/
if (y_type == MCHAR && y_size == 1)
{
- linenr_T end;
+ linenr_T end_lnum = 0; /* init for gcc */
if (VIsual_active)
{
- end = curbuf->b_visual.vi_end.lnum;
- if (end < curbuf->b_visual.vi_start.lnum)
- end = curbuf->b_visual.vi_start.lnum;
+ end_lnum = curbuf->b_visual.vi_end.lnum;
+ if (end_lnum < curbuf->b_visual.vi_start.lnum)
+ end_lnum = curbuf->b_visual.vi_start.lnum;
}
do {
@@ -3815,7 +3815,7 @@ do_put(
}
if (VIsual_active)
lnum++;
- } while (VIsual_active && lnum <= end);
+ } while (VIsual_active && lnum <= end_lnum);
if (VIsual_active) /* reset lnum to the last visual line */
lnum--;
diff --git a/src/version.c b/src/version.c
index 65208d0a0..684a244cd 100644
--- a/src/version.c
+++ b/src/version.c
@@ -765,6 +765,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 236,
+/**/
235,
/**/
234,