diff src/regexp_nfa.c @ 8989:e600e696c0a1 v7.4.1780

commit https://github.com/vim/vim/commit/dc633cf82758f67f656cda7fa8ccc30414ee53f8 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Apr 23 14:33:19 2016 +0200 patch 7.4.1780 Problem: Warnings reported by cppcheck. Solution: Fix the warnings. (Dominique Pelle)
author Christian Brabandt <cb@256bit.org>
date Sat, 23 Apr 2016 14:45:05 +0200
parents f196308a2813
children 42b228c8701b
line wrap: on
line diff
--- 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. */