Mercurial > vim
comparison src/search.c @ 15758:675dd5d7afb3 v8.1.0886
patch 8.1.0886: compiler warning for NULL pointer and condition always true
commit https://github.com/vim/vim/commit/b7633611611eeb5f14f8fd598afa687964e23f23
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Feb 10 21:48:25 2019 +0100
patch 8.1.0886: compiler warning for NULL pointer and condition always true
Problem: Compiler warning for adding to NULL pointer and a condition that
is always true.
Solution: Check for NULL pointer before adding. Remove useless "if".
(Friedirch, closes #3913)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 10 Feb 2019 22:00:07 +0100 |
parents | ad8b2c109b22 |
children | a6ca8cf07a98 |
comparison
equal
deleted
inserted
replaced
15757:9c8c31c75022 | 15758:675dd5d7afb3 |
---|---|
4730 if (LT_POS(VIsual, end_pos)) | 4730 if (LT_POS(VIsual, end_pos)) |
4731 dec_cursor(); | 4731 dec_cursor(); |
4732 VIsual_active = TRUE; | 4732 VIsual_active = TRUE; |
4733 VIsual_mode = 'v'; | 4733 VIsual_mode = 'v'; |
4734 | 4734 |
4735 if (VIsual_active) | 4735 redraw_curbuf_later(INVERTED); /* update the inversion */ |
4736 { | 4736 if (*p_sel == 'e') |
4737 redraw_curbuf_later(INVERTED); /* update the inversion */ | 4737 { |
4738 if (*p_sel == 'e') | 4738 /* Correction for exclusive selection depends on the direction. */ |
4739 { | 4739 if (forward && LTOREQ_POS(VIsual, curwin->w_cursor)) |
4740 /* Correction for exclusive selection depends on the direction. */ | 4740 inc_cursor(); |
4741 if (forward && LTOREQ_POS(VIsual, curwin->w_cursor)) | 4741 else if (!forward && LTOREQ_POS(curwin->w_cursor, VIsual)) |
4742 inc_cursor(); | 4742 inc(&VIsual); |
4743 else if (!forward && LTOREQ_POS(curwin->w_cursor, VIsual)) | |
4744 inc(&VIsual); | |
4745 } | |
4746 | |
4747 } | 4743 } |
4748 | 4744 |
4749 #ifdef FEAT_FOLDING | 4745 #ifdef FEAT_FOLDING |
4750 if (fdo_flags & FDO_SEARCH && KeyTyped) | 4746 if (fdo_flags & FDO_SEARCH && KeyTyped) |
4751 foldOpenCursor(); | 4747 foldOpenCursor(); |