diff options
Diffstat (limited to 'src/nvim/fileio.c')
-rw-r--r-- | src/nvim/fileio.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index 26376afa27..badb5b85b0 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -6305,7 +6305,7 @@ bool has_event(int event) FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT /// @param force When true, ignore autocmd_busy /// @param group autocmd group ID or AUGROUP_ALL /// @param buf Buffer for <abuf> -/// @param exarg Ex command arguments +/// @param eap Ex command arguments /// /// @return true if some commands were executed. static bool apply_autocmds_group(event_T event, char_u *fname, char_u *fname_io, @@ -7106,6 +7106,7 @@ char_u * file_pat_to_reg_pat( char *allow_dirs, // Result passed back out in here int no_bslash // Don't use a backward slash as pathsep ) + FUNC_ATTR_NONNULL_ARG(1) { const char_u *endp; char_u *reg_pat; @@ -7118,6 +7119,10 @@ char_u * file_pat_to_reg_pat( if (pat_end == NULL) pat_end = pat + STRLEN(pat); + if (pat_end == pat) { + return (char_u *)xstrdup("^$"); + } + size_t size = 2; // '^' at start, '$' at end. for (p = pat; p < pat_end; p++) { |