aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2018-04-22 19:47:45 +0300
committerZyX <kp-pav@yandex.ru>2018-04-22 19:47:45 +0300
commit2cdf9d1388ee82dd2d326e45122f47e9d6fbc673 (patch)
tree25ae7692b2e59e203a49185bceac0c23bd4db545
parentdb1c9b625cd200a9ed2fc8dc842eb76a329eb144 (diff)
downloadrneovim-2cdf9d1388ee82dd2d326e45122f47e9d6fbc673.tar.gz
rneovim-2cdf9d1388ee82dd2d326e45122f47e9d6fbc673.tar.bz2
rneovim-2cdf9d1388ee82dd2d326e45122f47e9d6fbc673.zip
search: Fix PVS/V560: condition checked in previous if with goto
-rw-r--r--src/nvim/search.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/nvim/search.c b/src/nvim/search.c
index 3b726b6d08..b252612e5d 100644
--- a/src/nvim/search.c
+++ b/src/nvim/search.c
@@ -3396,11 +3396,13 @@ again:
goto again;
}
- if (do_include || r < 1) {
- /* Include up to the '>'. */
- while (*get_cursor_pos_ptr() != '>')
- if (inc_cursor() < 0)
+ if (do_include) {
+ // Include up to the '>'.
+ while (*get_cursor_pos_ptr() != '>') {
+ if (inc_cursor() < 0) {
break;
+ }
+ }
} else {
char_u *c = get_cursor_pos_ptr();
// Exclude the '<' of the end tag.