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:
Enan Ajmain
2022-07-18 06:00:08 +06:00
committed by GitHub
parent 776913e32e
commit 1b462705d0
4 changed files with 28 additions and 2 deletions

View File

@@ -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;
}

View File

@@ -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;
}