aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/path.c
diff options
context:
space:
mode:
authorckelsel <ckelsel@hotmail.com>2017-10-07 18:14:09 +0800
committerckelsel <ckelsel@hotmail.com>2017-10-07 18:14:09 +0800
commitf2b9ccec106b6c4619cc762ea77546810f1cbfd4 (patch)
tree93fb82598ecf1d227137cd093c16cc14b537e76c /src/nvim/path.c
parentfae55937ac31c0d61c2c89ed0e9be43f3bd2a759 (diff)
parent01487d4385aeffae4b2365689c7d798f740f7100 (diff)
downloadrneovim-f2b9ccec106b6c4619cc762ea77546810f1cbfd4.tar.gz
rneovim-f2b9ccec106b6c4619cc762ea77546810f1cbfd4.tar.bz2
rneovim-f2b9ccec106b6c4619cc762ea77546810f1cbfd4.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'src/nvim/path.c')
-rw-r--r--src/nvim/path.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/nvim/path.c b/src/nvim/path.c
index f2339c8046..51adcfb135 100644
--- a/src/nvim/path.c
+++ b/src/nvim/path.c
@@ -1690,6 +1690,9 @@ int vim_FullName(const char *fname, char *buf, size_t len, bool force)
if (strlen(fname) > (len - 1)) {
xstrlcpy(buf, fname, len); // truncate
+#ifdef WIN32
+ slash_adjust(buf);
+#endif
return FAIL;
}
@@ -1702,6 +1705,9 @@ int vim_FullName(const char *fname, char *buf, size_t len, bool force)
if (rv == FAIL) {
xstrlcpy(buf, fname, len); // something failed; use the filename
}
+#ifdef WIN32
+ slash_adjust(buf);
+#endif
return rv;
}
@@ -2196,11 +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, '/')) != NULL) {
+ if ((p = vim_strrchr(fname, PATHSEP)) != NULL) {
// relative to root
if (p == fname) {
// only one path component
- relative_directory[0] = '/';
+ relative_directory[0] = PATHSEP;
relative_directory[1] = NUL;
} else {
assert(p >= fname);