summaryrefslogtreecommitdiff
path: root/src/regexp_nfa.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-04-23 14:33:19 +0200
committerBram Moolenaar <Bram@vim.org>2016-04-23 14:33:19 +0200
commitdc633cf82758f67f656cda7fa8ccc30414ee53f8 (patch)
treee8a018a83d53136a6891b4ee4d37a8eb4183ce53 /src/regexp_nfa.c
parent73dfe917ba6357413aaf98a021c91add5ac6e9bc (diff)
downloadvim-git-dc633cf82758f67f656cda7fa8ccc30414ee53f8.tar.gz
patch 7.4.1780v7.4.1780
Problem: Warnings reported by cppcheck. Solution: Fix the warnings. (Dominique Pelle)
Diffstat (limited to 'src/regexp_nfa.c')
-rw-r--r--src/regexp_nfa.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c
index 6d06a121d..5e073eeeb 100644
--- a/src/regexp_nfa.c
+++ b/src/regexp_nfa.c
@@ -5515,14 +5515,9 @@ nfa_regmatch(
int add_off = 0;
int toplevel = start->c == NFA_MOPEN;
#ifdef NFA_REGEXP_DEBUG_LOG
- FILE *debug = fopen(NFA_REGEXP_DEBUG_LOG, "a");
-
- if (debug == NULL)
- {
- EMSG2(_("(NFA) COULD NOT OPEN %s !"), NFA_REGEXP_DEBUG_LOG);
- return FALSE;
- }
+ FILE *debug;
#endif
+
/* Some patterns may take a long time to match, especially when using
* recursive_regmatch(). Allow interrupting them with CTRL-C. */
fast_breakcheck();
@@ -5533,6 +5528,14 @@ nfa_regmatch(
return FALSE;
#endif
+#ifdef NFA_REGEXP_DEBUG_LOG
+ debug = fopen(NFA_REGEXP_DEBUG_LOG, "a");
+ if (debug == NULL)
+ {
+ EMSG2(_("(NFA) COULD NOT OPEN %s !"), NFA_REGEXP_DEBUG_LOG);
+ return FALSE;
+ }
+#endif
nfa_match = FALSE;
/* Allocate memory for the lists of nodes. */