Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit081eb72

Browse files
authored
refactor(regexp_nfa.c): match where Vim calls fopen() (#18778)
1 parent0dd3798 commit081eb72

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

‎src/nvim/regexp_nfa.c‎

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5948,30 +5948,24 @@ static int nfa_regmatch(nfa_regprog_T *prog, nfa_state_T *start, regsubs_T *subm
59485948
intadd_off=0;
59495949
inttoplevel=start->c==NFA_MOPEN;
59505950
regsubs_T*r;
5951-
#ifdefNFA_REGEXP_DEBUG_LOG
5952-
FILE*debug=fopen(NFA_REGEXP_DEBUG_LOG,"a");
5953-
5954-
if (debug==NULL) {
5955-
semsg("(NFA) COULD NOT OPEN %s!",NFA_REGEXP_DEBUG_LOG);
5956-
return false;
5957-
}
5958-
#endif
59595951
// Some patterns may take a long time to match, especially when using
59605952
// recursive_regmatch(). Allow interrupting them with CTRL-C.
59615953
fast_breakcheck();
59625954
if (got_int) {
5963-
#ifdefNFA_REGEXP_DEBUG_LOG
5964-
fclose(debug);
5965-
#endif
59665955
return false;
59675956
}
59685957
if (nfa_did_time_out()) {
5969-
#ifdefNFA_REGEXP_DEBUG_LOG
5970-
fclose(debug);
5971-
#endif
59725958
return false;
59735959
}
59745960

5961+
#ifdefNFA_REGEXP_DEBUG_LOG
5962+
FILE*debug=fopen(NFA_REGEXP_DEBUG_LOG,"a");
5963+
5964+
if (debug==NULL) {
5965+
semsg("(NFA) COULD NOT OPEN %s!",NFA_REGEXP_DEBUG_LOG);
5966+
return false;
5967+
}
5968+
#endif
59755969
nfa_match= false;
59765970

59775971
// Allocate memory for the lists of nodes.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp