mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
parent
e129e2792d
commit
917ba54ff5
@ -390,14 +390,14 @@ static char_u *vim_version_dir(char_u *vimdir)
|
|||||||
|
|
||||||
/// If the string between "p" and "pend" ends in "name/", return "pend" minus
|
/// If the string between "p" and "pend" ends in "name/", return "pend" minus
|
||||||
/// the length of "name/". Otherwise return "pend".
|
/// the length of "name/". Otherwise return "pend".
|
||||||
static char_u *remove_tail(char_u *p, char_u *pend, char_u *name)
|
static char *remove_tail(char *p, char *pend, char *name)
|
||||||
{
|
{
|
||||||
int len = (int)STRLEN(name) + 1;
|
size_t len = STRLEN(name) + 1;
|
||||||
char_u *newend = pend - len;
|
char *newend = pend - len;
|
||||||
|
|
||||||
if (newend >= p
|
if (newend >= p
|
||||||
&& fnamencmp(newend, name, len - 1) == 0
|
&& fnamencmp((char_u *)newend, (char_u *)name, len - 1) == 0
|
||||||
&& (newend == p || after_pathsep(p, newend)))
|
&& (newend == p || after_pathsep((char_u *)p, (char_u *)newend)))
|
||||||
return newend;
|
return newend;
|
||||||
return pend;
|
return pend;
|
||||||
}
|
}
|
||||||
@ -464,12 +464,14 @@ char_u *vim_getenv(char_u *name, bool *mustfree)
|
|||||||
|
|
||||||
/* remove "doc/" from 'helpfile', if present */
|
/* remove "doc/" from 'helpfile', if present */
|
||||||
if (p == p_hf)
|
if (p == p_hf)
|
||||||
pend = remove_tail(p, pend, (char_u *)"doc");
|
pend = (char_u *)remove_tail((char *)p, (char *)pend, "doc");
|
||||||
|
|
||||||
/* for $VIM, remove "runtime/" or "vim54/", if present */
|
/* for $VIM, remove "runtime/" or "vim54/", if present */
|
||||||
if (!vimruntime) {
|
if (!vimruntime) {
|
||||||
pend = remove_tail(p, pend, (char_u *)RUNTIME_DIRNAME);
|
pend = (char_u *)remove_tail((char *)p, (char *)pend,
|
||||||
pend = remove_tail(p, pend, (char_u *)VIM_VERSION_NODOT);
|
RUNTIME_DIRNAME);
|
||||||
|
pend = (char_u *)remove_tail((char *)p, (char *)pend,
|
||||||
|
VIM_VERSION_NODOT);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* remove trailing path separator */
|
/* remove trailing path separator */
|
||||||
|
Loading…
Reference in New Issue
Block a user