diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2015-02-02 01:21:58 -0500 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2015-02-02 01:21:58 -0500 |
commit | 6360be982fb2683a8ea5d7708e0651937349f9cb (patch) | |
tree | 8d53a3adc475f4e424a99dec330f51858e4ad8c9 /src/nvim/ex_docmd.c | |
parent | 4d70aae770e33c45a194634d11b9c49e866dd84b (diff) | |
parent | bb674e0fcdc19ee069ad5130e5978d24b90765d0 (diff) | |
download | rneovim-6360be982fb2683a8ea5d7708e0651937349f9cb.tar.gz rneovim-6360be982fb2683a8ea5d7708e0651937349f9cb.tar.bz2 rneovim-6360be982fb2683a8ea5d7708e0651937349f9cb.zip |
Merge #1896 'Fix coverity issues. (3)'
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r-- | src/nvim/ex_docmd.c | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index f6527db69b..9b48398d96 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -3219,27 +3219,15 @@ get_address ( } if (!skip) { - /* - * When search follows another address, start from - * there. - */ - if (lnum != MAXLNUM) - pos.lnum = lnum; - else - pos.lnum = curwin->w_cursor.lnum; - - /* - * Start the search just like for the above - * do_search(). - */ - if (*cmd != '?') - pos.col = MAXCOL; - else - pos.col = 0; + // When search follows another address, start from there. + pos.lnum = (lnum != MAXLNUM) ? lnum : curwin->w_cursor.lnum; + // Start the search just like for the above do_search(). + pos.col = (*cmd != '?') ? MAXCOL : 0; + pos.coladd = 0; if (searchit(curwin, curbuf, &pos, - *cmd == '?' ? BACKWARD : FORWARD, - (char_u *)"", 1L, SEARCH_MSG, - i, (linenr_T)0, NULL) != FAIL) + *cmd == '?' ? BACKWARD : FORWARD, + (char_u *)"", 1L, SEARCH_MSG, + i, (linenr_T)0, NULL) != FAIL) lnum = pos.lnum; else { cmd = NULL; |