diff options
author | Mark Bainter <mbainter+github@gmail.com> | 2015-04-12 20:36:34 +0000 |
---|---|---|
committer | Mark Bainter <mbainter+github@gmail.com> | 2015-04-17 14:46:58 +0000 |
commit | 9a5e87ac83d2a0f88c183e13695910e950fd457b (patch) | |
tree | 4f472314f96782c0aac8ba7282f4a84eb155d3b9 /src | |
parent | c1a3d289d69b93092247e0eca3bf4b43992791a1 (diff) | |
download | rneovim-9a5e87ac83d2a0f88c183e13695910e950fd457b.tar.gz rneovim-9a5e87ac83d2a0f88c183e13695910e950fd457b.tar.bz2 rneovim-9a5e87ac83d2a0f88c183e13695910e950fd457b.zip |
Remove char_u: after_pathstep()
See: #459
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/eval.c | 8 | ||||
-rw-r--r-- | src/nvim/fileio.c | 4 | ||||
-rw-r--r-- | src/nvim/memline.c | 4 | ||||
-rw-r--r-- | src/nvim/os/env.c | 6 | ||||
-rw-r--r-- | src/nvim/path.c | 12 |
5 files changed, 17 insertions, 17 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index d6a8351330..8444432350 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -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); } } diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index def1cc1d1a..4a0a9da768 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -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; } diff --git a/src/nvim/memline.c b/src/nvim/memline.c index a72dc43eb4..8e87bef244 100644 --- a/src/nvim/memline.c +++ b/src/nvim/memline.c @@ -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); diff --git a/src/nvim/os/env.c b/src/nvim/os/env.c index be4b22de3a..0dd5d62ce9 100644 --- a/src/nvim/os/env.c +++ b/src/nvim/os/env.c @@ -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 diff --git a/src/nvim/path.c b/src/nvim/path.c index 36d550b764..f09c67a439 100644 --- a/src/nvim/path.c +++ b/src/nvim/path.c @@ -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 |