diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-09-13 18:51:13 -0700 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-09-13 19:29:25 -0700 |
commit | 6aae0e7c943267d2109ae20ec5086791c3b94a5e (patch) | |
tree | b0a8ec8985c5bdfb1882ee847ff64b42c98d3e0a /src/nvim/regexp.c | |
parent | 3344cffe7bf77c984550c01f9405f4d757150d8a (diff) | |
download | rneovim-6aae0e7c943267d2109ae20ec5086791c3b94a5e.tar.gz rneovim-6aae0e7c943267d2109ae20ec5086791c3b94a5e.tar.bz2 rneovim-6aae0e7c943267d2109ae20ec5086791c3b94a5e.zip |
lint
Diffstat (limited to 'src/nvim/regexp.c')
-rw-r--r-- | src/nvim/regexp.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c index 97c410a647..9bc7ef07eb 100644 --- a/src/nvim/regexp.c +++ b/src/nvim/regexp.c @@ -3105,23 +3105,26 @@ static int read_limits(long *minval, long *maxval) long tmp; if (*regparse == '-') { - /* Starts with '-', so reverse the range later */ + // Starts with '-', so reverse the range later. regparse++; reverse = TRUE; } first_char = regparse; *minval = getdigits_long(®parse, false, 0); - if (*regparse == ',') { /* There is a comma */ - if (ascii_isdigit(*++regparse)) + if (*regparse == ',') { // There is a comma. + if (ascii_isdigit(*++regparse)) { *maxval = getdigits_long(®parse, false, MAX_LIMIT); - else + } else { *maxval = MAX_LIMIT; - } else if (ascii_isdigit(*first_char)) - *maxval = *minval; /* It was \{n} or \{-n} */ - else - *maxval = MAX_LIMIT; /* It was \{} or \{-} */ - if (*regparse == '\\') - regparse++; /* Allow either \{...} or \{...\} */ + } + } else if (ascii_isdigit(*first_char)) { + *maxval = *minval; // It was \{n} or \{-n} + } else { + *maxval = MAX_LIMIT; // It was \{} or \{-} + } + if (*regparse == '\\') { + regparse++; // Allow either \{...} or \{...\} + } if (*regparse != '}') { sprintf((char *)IObuff, _("E554: Syntax error in %s{...}"), reg_magic == MAGIC_ALL ? "" : "\\"); |