aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/regexp_nfa.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/regexp_nfa.c')
-rw-r--r--src/nvim/regexp_nfa.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/nvim/regexp_nfa.c b/src/nvim/regexp_nfa.c
index 35c3285cda..039f9b4675 100644
--- a/src/nvim/regexp_nfa.c
+++ b/src/nvim/regexp_nfa.c
@@ -1161,8 +1161,6 @@ static int nfa_regatom(void)
int emit_range;
int negated;
int startc = -1;
- int endc = -1;
- int oldstartc = -1;
int save_prev_at_start = prev_at_start;
c = getchr();
@@ -1572,7 +1570,7 @@ collection:
* Failed to recognize a character class. Use the simple
* version that turns [abc] into 'a' OR 'b' OR 'c'
*/
- startc = endc = oldstartc = -1;
+ startc = -1;
negated = false;
if (*regparse == '^') { // negated range
negated = true;
@@ -1589,7 +1587,7 @@ collection:
// Emit the OR branches for each character in the []
emit_range = false;
while (regparse < endp) {
- oldstartc = startc;
+ int oldstartc = startc;
startc = -1;
got_coll_char = false;
if (*regparse == '[') {
@@ -1729,7 +1727,7 @@ collection:
/* Previous char was '-', so this char is end of range. */
if (emit_range) {
- endc = startc;
+ int endc = startc;
startc = oldstartc;
if (startc > endc) {
EMSG_RET_FAIL(_(e_reverse_range));