diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2015-10-25 22:38:23 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2015-10-25 22:38:23 -0400 |
commit | 1ca5646bb52ec5c23b28f45bb7bc5d25cffad9b0 (patch) | |
tree | 7495d3f50b897e74fc4597d061d427a4e9b1ae36 /src/nvim/os/fs.c | |
parent | de4cb766ca381c09fd3f938136c1932ebf008f63 (diff) | |
parent | 42047acb4f07c689936b051864c6b4448b1b6aa1 (diff) | |
download | rneovim-1ca5646bb52ec5c23b28f45bb7bc5d25cffad9b0.tar.gz rneovim-1ca5646bb52ec5c23b28f45bb7bc5d25cffad9b0.tar.bz2 rneovim-1ca5646bb52ec5c23b28f45bb7bc5d25cffad9b0.zip |
Merge pull request #3470 from ZyX-I/pr-3198
XDG base directory specification support
Diffstat (limited to 'src/nvim/os/fs.c')
-rw-r--r-- | src/nvim/os/fs.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/nvim/os/fs.c b/src/nvim/os/fs.c index 522e49950c..05f0f53c63 100644 --- a/src/nvim/os/fs.c +++ b/src/nvim/os/fs.c @@ -366,11 +366,17 @@ int os_mkdir_recurse(const char *const dir, int32_t mode, } while (e != real_end) { if (e > past_head) { - *e = '/'; + *e = PATHSEP; } else { *past_head = past_head_save; } - e += strlen(e); + const size_t component_len = strlen(e); + e += component_len; + if (e == real_end + && memcnt(e - component_len, PATHSEP, component_len) == component_len) { + // Path ends with something like "////". Ignore this. + break; + } int ret; if ((ret = os_mkdir(curdir, mode)) != 0) { *failed_dir = curdir; |