aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/fileio.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c
index 6b3e7dddb5..fbb5c4f1fa 100644
--- a/src/nvim/fileio.c
+++ b/src/nvim/fileio.c
@@ -5439,6 +5439,10 @@ bool match_file_list(char *list, char *sfname, char *ffname)
char *file_pat_to_reg_pat(const char *pat, const char *pat_end, char *allow_dirs, int no_bslash)
FUNC_ATTR_NONNULL_ARG(1)
{
+ if (allow_dirs != NULL) {
+ *allow_dirs = false;
+ }
+
if (pat_end == NULL) {
pat_end = pat + strlen(pat);
}
@@ -5447,10 +5451,6 @@ char *file_pat_to_reg_pat(const char *pat, const char *pat_end, char *allow_dirs
return xstrdup("^$");
}
- if (allow_dirs != NULL) {
- *allow_dirs = false;
- }
-
size_t size = 2; // '^' at start, '$' at end.
for (const char *p = pat; p < pat_end; p++) {