diff options
author | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-01-11 11:35:07 -0500 |
---|---|---|
committer | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-01-28 13:58:52 -0500 |
commit | 909c967f35c3d38be6d98d7dba6cfd087a6542f4 (patch) | |
tree | 46fa6513593fcb0306ff2ee74c3eecfd571ae817 /src/nvim/path.c | |
parent | a619c3fcf92e45e27066c472c3c9a0a1a2901b4d (diff) | |
download | rneovim-909c967f35c3d38be6d98d7dba6cfd087a6542f4.tar.gz rneovim-909c967f35c3d38be6d98d7dba6cfd087a6542f4.tar.bz2 rneovim-909c967f35c3d38be6d98d7dba6cfd087a6542f4.zip |
win: detect / and \ as root path separator
Diffstat (limited to 'src/nvim/path.c')
-rw-r--r-- | src/nvim/path.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/nvim/path.c b/src/nvim/path.c index 09cede8805..d18d9ecace 100644 --- a/src/nvim/path.c +++ b/src/nvim/path.c @@ -2202,7 +2202,11 @@ static int path_get_absolute_path(const char_u *fname, char_u *buf, // expand it if forced or not an absolute path if (force || !path_is_absolute_path(fname)) { - if ((p = vim_strrchr(fname, PATHSEP)) != NULL) { + p = vim_strrchr(fname, "/") +#ifdef WIN32 + if (p == NULL) p = vim_strrchr(fname, "\\") +#endif + if (p != NULL) { // relative to root if (p == fname) { // only one path component |