mirror of
https://github.com/neovim/neovim.git
synced 2025-10-02 16:08:36 +00:00
fix(windows):exepath, stdpath return wrong slashes #19111
exepath and stdpath should respect shellslash and return path with proper file separator. Closes #13787
This commit is contained in:
@@ -2048,6 +2048,12 @@ static void f_exepath(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||
|
||||
(void)os_can_exe(tv_get_string(&argvars[0]), &path, true);
|
||||
|
||||
#ifdef BACKSLASH_IN_FILENAME
|
||||
if (path != NULL) {
|
||||
slash_adjust((char_u *)path);
|
||||
}
|
||||
#endif
|
||||
|
||||
rettv->v_type = VAR_STRING;
|
||||
rettv->vval.v_string = path;
|
||||
}
|
||||
|
@@ -115,6 +115,10 @@ char *get_xdg_home(const XDGVarType idx)
|
||||
#else
|
||||
dir = concat_fnames_realloc(dir, "nvim", true);
|
||||
#endif
|
||||
|
||||
#ifdef BACKSLASH_IN_FILENAME
|
||||
slash_adjust((char_u *)dir);
|
||||
#endif
|
||||
}
|
||||
return dir;
|
||||
}
|
||||
|
Reference in New Issue
Block a user