mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
parent
c1a3d289d6
commit
9a5e87ac83
@ -12417,7 +12417,7 @@ static void f_resolve(typval_T *argvars, typval_T *rettv)
|
||||
is_relative_to_current = TRUE;
|
||||
|
||||
len = STRLEN(p);
|
||||
if (len > 0 && after_pathsep(p, p + len)) {
|
||||
if (len > 0 && after_pathsep((char *)p, (char *)p + len)) {
|
||||
has_trailing_pathsep = TRUE;
|
||||
p[len - 1] = NUL; /* the trailing slash breaks readlink() */
|
||||
}
|
||||
@ -12531,7 +12531,7 @@ static void f_resolve(typval_T *argvars, typval_T *rettv)
|
||||
* if the argument had none. But keep "/" or "//". */
|
||||
if (!has_trailing_pathsep) {
|
||||
q = p + STRLEN(p);
|
||||
if (after_pathsep(p, q))
|
||||
if (after_pathsep((char *)p, (char *)q))
|
||||
*path_tail_with_sep(p) = NUL;
|
||||
}
|
||||
|
||||
@ -19921,7 +19921,7 @@ repeat:
|
||||
valid |= VALID_HEAD;
|
||||
*usedlen += 2;
|
||||
s = get_past_head(*fnamep);
|
||||
while (tail > s && after_pathsep(s, tail))
|
||||
while (tail > s && after_pathsep((char *)s, (char *)tail))
|
||||
mb_ptr_back(*fnamep, tail);
|
||||
*fnamelen = (int)(tail - *fnamep);
|
||||
if (*fnamelen == 0) {
|
||||
@ -19930,7 +19930,7 @@ repeat:
|
||||
*bufp = *fnamep = tail = vim_strsave((char_u *)".");
|
||||
*fnamelen = 1;
|
||||
} else {
|
||||
while (tail > s && !after_pathsep(s, tail))
|
||||
while (tail > s && !after_pathsep((char *)s, (char *)tail))
|
||||
mb_ptr_back(*fnamep, tail);
|
||||
}
|
||||
}
|
||||
|
@ -422,7 +422,7 @@ readfile (
|
||||
*/
|
||||
if (fname != NULL && *fname != NUL) {
|
||||
p = fname + STRLEN(fname);
|
||||
if (after_pathsep(fname, p) || STRLEN(fname) >= MAXPATHL) {
|
||||
if (after_pathsep((char *)fname, (char *)p) || STRLEN(fname) >= MAXPATHL) {
|
||||
filemess(curbuf, fname, (char_u *)_("Illegal file name"), 0);
|
||||
msg_end();
|
||||
msg_scroll = msg_save;
|
||||
@ -4369,7 +4369,7 @@ modname (
|
||||
xfree(retval);
|
||||
return NULL;
|
||||
}
|
||||
if (!after_pathsep(retval, retval + fnamelen)) {
|
||||
if (!after_pathsep((char *)retval, (char *)retval + fnamelen)) {
|
||||
retval[fnamelen++] = PATHSEP;
|
||||
retval[fnamelen] = NUL;
|
||||
}
|
||||
|
@ -1340,7 +1340,7 @@ recover_names (
|
||||
num_names = 3;
|
||||
} else {
|
||||
p = dir_name + STRLEN(dir_name);
|
||||
if (after_pathsep(dir_name, p) && p[-1] == p[-2]) {
|
||||
if (after_pathsep((char *)dir_name, (char *)p) && p[-1] == p[-2]) {
|
||||
/* Ends with '//', Use Full path for swap name */
|
||||
tail = make_percent_swname(dir_name, fname_res);
|
||||
} else {
|
||||
@ -3066,7 +3066,7 @@ char_u *makeswapname(char_u *fname, char_u *ffname, buf_T *buf, char_u *dir_name
|
||||
#endif
|
||||
|
||||
s = dir_name + STRLEN(dir_name);
|
||||
if (after_pathsep(dir_name, s) && s[-1] == s[-2]) { /* Ends with '//', Use Full path */
|
||||
if (after_pathsep((char *)dir_name, (char *)s) && s[-1] == s[-2]) { /* Ends with '//', Use Full path */
|
||||
r = NULL;
|
||||
if ((s = make_percent_swname(dir_name, fname)) != NULL) {
|
||||
r = modname(s, (char_u *)".swp", FALSE);
|
||||
|
@ -343,7 +343,7 @@ void expand_env_esc(char_u *srcp, char_u *dst, int dstlen, bool esc, bool one,
|
||||
c = (int)STRLEN(var);
|
||||
/* if var[] ends in a path separator and tail[] starts
|
||||
* with it, skip a character */
|
||||
if (*var != NUL && after_pathsep(dst, dst + c)
|
||||
if (*var != NUL && after_pathsep((char *)dst, (char *)dst + c)
|
||||
#if defined(BACKSLASH_IN_FILENAME)
|
||||
&& dst[-1] != ':'
|
||||
#endif
|
||||
@ -410,7 +410,7 @@ static char *remove_tail(char *p, char *pend, char *name)
|
||||
|
||||
if (newend >= p
|
||||
&& fnamencmp((char_u *)newend, (char_u *)name, len - 1) == 0
|
||||
&& (newend == p || after_pathsep((char_u *)p, (char_u *)newend)))
|
||||
&& (newend == p || after_pathsep(p, newend)))
|
||||
return newend;
|
||||
return pend;
|
||||
}
|
||||
@ -488,7 +488,7 @@ char_u *vim_getenv(char_u *name, bool *mustfree)
|
||||
}
|
||||
|
||||
/* remove trailing path separator */
|
||||
if (pend > p && after_pathsep(p, pend))
|
||||
if (pend > p && after_pathsep((char *)p, (char *)pend))
|
||||
--pend;
|
||||
|
||||
// check that the result is a directory name
|
||||
|
@ -122,7 +122,7 @@ char_u *path_tail_with_sep(char_u *fname)
|
||||
// Don't remove the '/' from "c:/file".
|
||||
char_u *past_head = get_past_head(fname);
|
||||
char_u *tail = path_tail(fname);
|
||||
while (tail > past_head && after_pathsep(fname, tail)) {
|
||||
while (tail > past_head && after_pathsep((char *)fname, (char *)tail)) {
|
||||
tail--;
|
||||
}
|
||||
return tail;
|
||||
@ -353,7 +353,7 @@ char_u *concat_fnames(char_u *fname1, char_u *fname2, int sep)
|
||||
*/
|
||||
void add_pathsep(char_u *p)
|
||||
{
|
||||
if (*p != NUL && !after_pathsep(p, p + STRLEN(p)))
|
||||
if (*p != NUL && !after_pathsep((char *)p, (char *)p + STRLEN(p)))
|
||||
STRCAT(p, PATHSEPSTR);
|
||||
}
|
||||
|
||||
@ -1356,7 +1356,7 @@ void simplify_filename(char_u *filename)
|
||||
|
||||
--p;
|
||||
/* Skip back to after previous '/'. */
|
||||
while (p > start && !after_pathsep(start, p))
|
||||
while (p > start && !after_pathsep((char *)start, (char *)p))
|
||||
mb_ptr_back(start, p);
|
||||
|
||||
if (!do_strip) {
|
||||
@ -1682,10 +1682,10 @@ void path_fix_case(char_u *name)
|
||||
* Takes care of multi-byte characters.
|
||||
* "b" must point to the start of the file name
|
||||
*/
|
||||
int after_pathsep(char_u *b, char_u *p)
|
||||
int after_pathsep(char *b, char *p)
|
||||
{
|
||||
return p > b && vim_ispathsep(p[-1])
|
||||
&& (!has_mbyte || (*mb_head_off)(b, p - 1) == 0);
|
||||
&& (!has_mbyte || (*mb_head_off)((char_u *)b, (char_u *)p - 1) == 0);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1761,7 +1761,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((char_u *)s, (char_u *)s + i)
|
||||
&& !after_pathsep((char *)s, (char *)s + i)
|
||||
#ifdef BACKSLASH_IN_FILENAME
|
||||
&& (c1 == '/' || c1 == '\\')
|
||||
#else
|
||||
|
Loading…
Reference in New Issue
Block a user