diff options
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r-- | src/nvim/ex_docmd.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index b50c7330d3..59bda9345e 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -1,12 +1,4 @@ /* - * VIM - Vi IMproved by Bram Moolenaar - * - * Do ":help uganda" in Vim to read copying and usage conditions. - * Do ":help credits" in Vim to see a list of people who contributed. - * See README.md for an overview of the Vim source code. - */ - -/* * ex_docmd.c: functions for executing an Ex command line. */ @@ -3454,6 +3446,7 @@ static linenr_T get_address(char_u **ptr, } if (addr_type != ADDR_LINES) { EMSG(_(e_invaddr)); + cmd = NULL; goto error; } if (skip) @@ -3481,6 +3474,7 @@ static linenr_T get_address(char_u **ptr, c = *cmd++; if (addr_type != ADDR_LINES) { EMSG(_(e_invaddr)); + cmd = NULL; goto error; } if (skip) { /* skip "/pat/" */ @@ -3524,6 +3518,7 @@ static linenr_T get_address(char_u **ptr, ++cmd; if (addr_type != ADDR_LINES) { EMSG(_(e_invaddr)); + cmd = NULL; goto error; } if (*cmd == '&') @@ -3595,7 +3590,8 @@ static linenr_T get_address(char_u **ptr, else n = getdigits(&cmd); if (addr_type == ADDR_LOADED_BUFFERS || addr_type == ADDR_BUFFERS) - lnum = compute_buffer_local_count(addr_type, lnum, (i == '-') ? -1 * n : n); + lnum = compute_buffer_local_count( + addr_type, lnum, (i == '-') ? -1 * n : n); else if (i == '-') lnum -= n; else @@ -3663,7 +3659,8 @@ static char_u *invalid_range(exarg_T *eap) } break; case ADDR_ARGUMENTS: - if (eap->line2 > ARGCOUNT + (!ARGCOUNT)) { // add 1 if ARGCOUNT is 0 + // add 1 if ARGCOUNT is 0 + if (eap->line2 > ARGCOUNT + (!ARGCOUNT)) { return (char_u *)_(e_invrange); } break; |