diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/eval.c | 4 | ||||
-rw-r--r-- | src/nvim/ex_cmds.c | 6 | ||||
-rw-r--r-- | src/nvim/ex_cmds2.c | 2 | ||||
-rw-r--r-- | src/nvim/ex_docmd.c | 2 | ||||
-rw-r--r-- | src/nvim/ex_getln.c | 4 | ||||
-rw-r--r-- | src/nvim/file_search.c | 14 | ||||
-rw-r--r-- | src/nvim/hardcopy.c | 2 | ||||
-rw-r--r-- | src/nvim/os_unix.c | 2 | ||||
-rw-r--r-- | src/nvim/path.c | 17 | ||||
-rw-r--r-- | src/nvim/quickfix.c | 2 | ||||
-rw-r--r-- | src/nvim/tempfile.c | 4 |
11 files changed, 30 insertions, 29 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index df301f4266..bae09d8c53 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -12478,7 +12478,7 @@ static void f_resolve(typval_T *argvars, typval_T *rettv) /* Ensure that the result will have a trailing path separator * if the argument has one. */ if (remain == NULL && has_trailing_pathsep) - add_pathsep(buf); + add_pathsep((char *)buf); /* Separate the first path component in the link value and * concatenate the remainders. */ @@ -19921,7 +19921,7 @@ repeat: *bufp = *fnamep; if (*fnamep == NULL) return -1; - add_pathsep(*fnamep); + add_pathsep((char *)*fnamep); } } diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index 78200e4689..830636fb66 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -5126,7 +5126,7 @@ void fix_help_buffer(void) char_u *cp; /* Find all "doc/ *.txt" files in this directory. */ - add_pathsep(NameBuff); + add_pathsep((char *)NameBuff); STRCAT(NameBuff, "doc/*.??[tx]"); // Note: We cannot just do `&NameBuff` because it is a statically sized array @@ -5297,7 +5297,7 @@ void ex_helptags(exarg_T *eap) /* Get a list of all files in the help directory and in subdirectories. */ STRCPY(NameBuff, dirname); - add_pathsep(NameBuff); + add_pathsep((char *)NameBuff); STRCAT(NameBuff, "**"); // Note: We cannot just do `&NameBuff` because it is a statically sized array @@ -5419,7 +5419,7 @@ helptags_one ( * Do this before scanning through all the files. */ STRCPY(NameBuff, dir); - add_pathsep(NameBuff); + add_pathsep((char *)NameBuff); STRCAT(NameBuff, tagfname); fd_tags = mch_fopen((char *)NameBuff, "w"); if (fd_tags == NULL) { diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c index b79d09885c..953105513b 100644 --- a/src/nvim/ex_cmds2.c +++ b/src/nvim/ex_cmds2.c @@ -2144,7 +2144,7 @@ int do_in_runtimepath(char_u *name, int all, DoInRuntimepathCB callback, if (!did_one) did_one = (cookie == NULL); } else if (STRLEN(buf) + STRLEN(name) + 2 < MAXPATHL) { - add_pathsep(buf); + add_pathsep((char *)buf); tail = buf + STRLEN(buf); /* Loop over all patterns in "name" */ diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 9ff19521b6..bb71201959 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -9089,7 +9089,7 @@ static char_u *get_view_file(int c) ++len; retval = xmalloc(STRLEN(sname) + len + STRLEN(p_vdir) + 9); STRCPY(retval, p_vdir); - add_pathsep(retval); + add_pathsep((char *)retval); s = retval + STRLEN(retval); for (p = sname; *p; ++p) { if (*p == '=') { diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index 1a04f1bd91..3af035a6e3 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -3890,7 +3890,7 @@ static void expand_shellcmd(char_u *filepat, int *num_file, char_u ***file, if (l > MAXPATHL - 5) break; STRLCPY(buf, s, l + 1); - add_pathsep(buf); + add_pathsep((char *)buf); l = STRLEN(buf); STRLCPY(buf + l, pat, MAXPATHL - l); @@ -4107,7 +4107,7 @@ void globpath(char_u *path, char_u *file, garray_T *ga, int expand_options) // Copy one item of the path to buf[] and concatenate the file name. copy_option_part(&path, buf, MAXPATHL, ","); if (STRLEN(buf) + STRLEN(file) + 2 < MAXPATHL) { - add_pathsep(buf); + add_pathsep((char *)buf); STRCAT(buf, file); // NOLINT char_u **p; diff --git a/src/nvim/file_search.c b/src/nvim/file_search.c index 2777271377..b07973853b 100644 --- a/src/nvim/file_search.c +++ b/src/nvim/file_search.c @@ -465,7 +465,7 @@ vim_findfile_init ( goto error_return; } STRCPY(ff_expand_buffer, search_ctx->ffsc_start_dir); - add_pathsep(ff_expand_buffer); + add_pathsep((char *)ff_expand_buffer); { size_t eb_len = STRLEN(ff_expand_buffer); char_u *buf = xmalloc(eb_len + STRLEN(search_ctx->ffsc_fix_path) + 1); @@ -474,7 +474,7 @@ vim_findfile_init ( STRCPY(buf + eb_len, search_ctx->ffsc_fix_path); if (os_isdir(buf)) { STRCAT(ff_expand_buffer, search_ctx->ffsc_fix_path); - add_pathsep(ff_expand_buffer); + add_pathsep((char *)ff_expand_buffer); } else { char_u *p = path_tail(search_ctx->ffsc_fix_path); char_u *wc_path = NULL; @@ -484,7 +484,7 @@ vim_findfile_init ( if (p > search_ctx->ffsc_fix_path) { len = (int)(p - search_ctx->ffsc_fix_path) - 1; STRNCAT(ff_expand_buffer, search_ctx->ffsc_fix_path, len); - add_pathsep(ff_expand_buffer); + add_pathsep((char *)ff_expand_buffer); } else len = (int)STRLEN(search_ctx->ffsc_fix_path); @@ -695,12 +695,12 @@ char_u *vim_findfile(void *search_ctx_arg) if (!vim_isAbsName(stackp->ffs_fix_path) && search_ctx->ffsc_start_dir) { STRCPY(file_path, search_ctx->ffsc_start_dir); - add_pathsep(file_path); + add_pathsep((char *)file_path); } /* append the fix part of the search path */ STRCAT(file_path, stackp->ffs_fix_path); - add_pathsep(file_path); + add_pathsep((char *)file_path); rest_of_wildcards = stackp->ffs_wc_path; if (*rest_of_wildcards != NUL) { @@ -784,7 +784,7 @@ char_u *vim_findfile(void *search_ctx_arg) /* prepare the filename to be checked for existence * below */ STRCPY(file_path, stackp->ffs_filearray[i]); - add_pathsep(file_path); + add_pathsep((char *)file_path); STRCAT(file_path, search_ctx->ffsc_file_to_search); /* @@ -936,7 +936,7 @@ char_u *vim_findfile(void *search_ctx_arg) break; STRCPY(file_path, search_ctx->ffsc_start_dir); - add_pathsep(file_path); + add_pathsep((char *)file_path); STRCAT(file_path, search_ctx->ffsc_fix_path); /* create a new stack entry */ diff --git a/src/nvim/hardcopy.c b/src/nvim/hardcopy.c index cf33703fdb..819015a85d 100644 --- a/src/nvim/hardcopy.c +++ b/src/nvim/hardcopy.c @@ -1532,7 +1532,7 @@ static int prt_find_resource(char *name, struct prt_ps_resource_S *resource) STRLCPY(resource->name, name, 64); /* Look for named resource file in runtimepath */ STRCPY(buffer, "print"); - add_pathsep(buffer); + add_pathsep((char *)buffer); vim_strcat(buffer, (char_u *)name, MAXPATHL); vim_strcat(buffer, (char_u *)".ps", MAXPATHL); resource->filename[0] = NUL; diff --git a/src/nvim/os_unix.c b/src/nvim/os_unix.c index 7f2efd8d68..b2d5bae477 100644 --- a/src/nvim/os_unix.c +++ b/src/nvim/os_unix.c @@ -625,7 +625,7 @@ int mch_expand_wildcards(int num_pat, char_u **pat, int *num_file, p = xmalloc(STRLEN((*file)[i]) + 1 + dir); STRCPY(p, (*file)[i]); if (dir) - add_pathsep(p); /* add '/' to a directory name */ + add_pathsep((char *)p); /* add '/' to a directory name */ (*file)[j++] = p; } xfree(buffer); diff --git a/src/nvim/path.c b/src/nvim/path.c index d1dd94c190..2f7d0fd4dd 100644 --- a/src/nvim/path.c +++ b/src/nvim/path.c @@ -340,7 +340,7 @@ char_u *concat_fnames(char_u *fname1, char_u *fname2, int sep) STRCPY(dest, fname1); if (sep) { - add_pathsep(dest); + add_pathsep((char *)dest); } STRCAT(dest, fname2); @@ -351,10 +351,11 @@ char_u *concat_fnames(char_u *fname1, char_u *fname2, int sep) * Add a path separator to a file name, unless it already ends in a path * separator. */ -void add_pathsep(char_u *p) +void add_pathsep(char *p) + FUNC_ATTR_NONNULL_ALL { - if (*p != NUL && !after_pathsep((char *)p, (char *)p + STRLEN(p))) - STRCAT(p, PATHSEPSTR); + if (*p != NUL && !after_pathsep(p, p + strlen(p))) + strcat(p, PATHSEPSTR); } /* @@ -880,7 +881,7 @@ static void uniquefy_paths(garray_T *gap, char_u *pattern) if (short_name != NULL && short_name > path + 1 ) { STRCPY(path, "."); - add_pathsep(path); + add_pathsep((char *)path); STRMOVE(path + STRLEN(path), short_name); } } @@ -907,7 +908,7 @@ static void uniquefy_paths(garray_T *gap, char_u *pattern) rel_path = xmalloc(STRLEN(short_name) + STRLEN(PATHSEPSTR) + 2); STRCPY(rel_path, "."); - add_pathsep(rel_path); + add_pathsep((char *)rel_path); STRCAT(rel_path, short_name); xfree(fnames[i]); @@ -1278,7 +1279,7 @@ addfile ( * Append a slash or backslash after directory names if none is present. */ if (isdir && (flags & EW_ADDSLASH)) - add_pathsep(p); + add_pathsep((char *)p); GA_APPEND(char_u *, gap, p); } @@ -1761,7 +1762,7 @@ int pathcmp(const char *p, const char *q, int maxlen) /* ignore a trailing slash, but not "//" or ":/" */ if (c2 == NUL && i > 0 - && !after_pathsep(s, s + i) + && !after_pathsep((char *)s, (char *)s + i) #ifdef BACKSLASH_IN_FILENAME && (c1 == '/' || c1 == '\\') #else diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index a37a41caeb..9b51a2bf62 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -3546,7 +3546,7 @@ void ex_helpgrep(exarg_T *eap) copy_option_part(&p, NameBuff, MAXPATHL, ","); /* Find all "*.txt" and "*.??x" files in the "doc" directory. */ - add_pathsep(NameBuff); + add_pathsep((char *)NameBuff); STRCAT(NameBuff, "doc/*.\\(txt\\|??x\\)"); // Note: We cannot just do `&NameBuff` because it is a statically sized array diff --git a/src/nvim/tempfile.c b/src/nvim/tempfile.c index 1b51b226db..952f68054d 100644 --- a/src/nvim/tempfile.c +++ b/src/nvim/tempfile.c @@ -37,7 +37,7 @@ static void vim_maketempdir(void) continue; } - add_pathsep(template); + add_pathsep((char *)template); // Concatenate with temporary directory name pattern STRCAT(template, "nvimXXXXXX"); @@ -107,7 +107,7 @@ static bool vim_settempdir(char_u *tempdir) return false; } vim_FullName(tempdir, buf, MAXPATHL, false); - add_pathsep(buf); + add_pathsep((char *)buf); vim_tempdir = vim_strsave(buf); xfree(buf); return true; |