diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2014-12-17 17:43:45 -0500 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2014-12-17 17:43:45 -0500 |
commit | 742ada086916212dd29c583b6f758612f9b1aa1d (patch) | |
tree | 14145671e4a19cac0c389a2929b57f8667a11a5f /src/nvim/syntax.c | |
parent | 10a45846dc959f8b3ab9436f0809e90d1adf4ee4 (diff) | |
parent | 5394796fd3068316cd7247d494e52fcf60cb5c60 (diff) | |
download | rneovim-742ada086916212dd29c583b6f758612f9b1aa1d.tar.gz rneovim-742ada086916212dd29c583b6f758612f9b1aa1d.tar.bz2 rneovim-742ada086916212dd29c583b6f758612f9b1aa1d.zip |
Merge pull request #1698 from elmart/clang-analysis-fixes-6
Fix clang analysis warnings. (6)
Diffstat (limited to 'src/nvim/syntax.c')
-rw-r--r-- | src/nvim/syntax.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c index b7a485598b..3deda0a8c9 100644 --- a/src/nvim/syntax.c +++ b/src/nvim/syntax.c @@ -5157,22 +5157,21 @@ get_id_list ( regmatch.rm_ic = TRUE; id = 0; for (int i = highlight_ga.ga_len; --i >= 0; ) { - if (!vim_regexec(®match, HL_TABLE()[i].sg_name, (colnr_T)0)) { - continue; - } - if (round == 2) { - /* Got more items than expected; can happen - * when adding items that match: - * "contains=a.*b,axb". - * Go back to first round */ - if (count >= total_count) { - free(retval); - round = 1; - } else - retval[count] = i + 1; + if (vim_regexec(®match, HL_TABLE()[i].sg_name, (colnr_T)0)) { + if (round == 2) { + /* Got more items than expected; can happen + * when adding items that match: + * "contains=a.*b,axb". + * Go back to first round */ + if (count >= total_count) { + free(retval); + round = 1; + } else + retval[count] = i + 1; + } + ++count; + id = -1; /* remember that we found one */ } - ++count; - id = -1; /* remember that we found one */ } vim_regfree(regmatch.regprog); } |