aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/file_search.c
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2021-10-18 09:08:46 -0400
committerJames McCoy <jamessan@jamessan.com>2021-11-01 06:41:28 -0400
commitefa924f66b183d9cf2404ce91c4f009c27e0515a (patch)
treeadc8c74cba88e76c2ae0548cd6e9b01804da9933 /src/nvim/file_search.c
parent684640f5518a483cf2bc48efc8f68449379cef69 (diff)
downloadrneovim-efa924f66b183d9cf2404ce91c4f009c27e0515a.tar.gz
rneovim-efa924f66b183d9cf2404ce91c4f009c27e0515a.tar.bz2
rneovim-efa924f66b183d9cf2404ce91c4f009c27e0515a.zip
vim-patch:8.1.0743: giving error messages is not flexible
Problem: Giving error messages is not flexible. Solution: Add semsg(). Change argument from "char_u *" to "char *", also for msg() and get rid of most MSG macros. (Ozaki Kiichi, closes vim/vim#3302) Also make emsg() accept a "char *" argument. Get rid of an enormous number of type casts. https://github.com/vim/vim/commit/f9e3e09fdc93be9f0d47afbc6c7df1188c2a5a0d
Diffstat (limited to 'src/nvim/file_search.c')
-rw-r--r--src/nvim/file_search.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/nvim/file_search.c b/src/nvim/file_search.c
index fca62353d5..9b0caa8da0 100644
--- a/src/nvim/file_search.c
+++ b/src/nvim/file_search.c
@@ -419,7 +419,7 @@ void *vim_findfile_init(char_u *path, char_u *filename, char_u *stopdirs, int le
len = 0;
while (*wc_part != NUL) {
if (len + 5 >= MAXPATHL) {
- EMSG(_(e_pathtoolong));
+ emsg(_(e_pathtoolong));
break;
}
if (STRNCMP(wc_part, "**", 2) == 0) {
@@ -437,7 +437,7 @@ void *vim_findfile_init(char_u *path, char_u *filename, char_u *stopdirs, int le
}
wc_part = (char_u *)errpt;
if (*wc_part != NUL && !vim_ispathsep(*wc_part)) {
- EMSG2(_(
+ semsg(_(
"E343: Invalid path: '**[number]' must be at the end of the path or be followed by '%s'."),
PATHSEPSTR);
goto error_return;
@@ -463,7 +463,7 @@ void *vim_findfile_init(char_u *path, char_u *filename, char_u *stopdirs, int le
// create an absolute path
if (STRLEN(search_ctx->ffsc_start_dir)
+ STRLEN(search_ctx->ffsc_fix_path) + 3 >= MAXPATHL) {
- EMSG(_(e_pathtoolong));
+ emsg(_(e_pathtoolong));
goto error_return;
}
STRCPY(ff_expand_buffer, search_ctx->ffsc_start_dir);
@@ -1570,18 +1570,18 @@ char_u *find_file_in_path_option(char_u *ptr, size_t len, int options, int first
if (file_name == NULL && (options & FNAME_MESS)) {
if (first == TRUE) {
if (find_what == FINDFILE_DIR) {
- EMSG2(_("E344: Can't find directory \"%s\" in cdpath"),
+ semsg(_("E344: Can't find directory \"%s\" in cdpath"),
ff_file_to_find);
} else {
- EMSG2(_("E345: Can't find file \"%s\" in path"),
+ semsg(_("E345: Can't find file \"%s\" in path"),
ff_file_to_find);
}
} else {
if (find_what == FINDFILE_DIR) {
- EMSG2(_("E346: No more directory \"%s\" found in cdpath"),
+ semsg(_("E346: No more directory \"%s\" found in cdpath"),
ff_file_to_find);
} else {
- EMSG2(_("E347: No more file \"%s\" found in path"),
+ semsg(_("E347: No more file \"%s\" found in path"),
ff_file_to_find);
}
}