0
0
mirror of https://github.com/vim/vim.git synced 2025-09-30 04:44:14 -04:00

patch 8.2.3543: swapname has double slash when 'directory' ends in it

Problem:    Swapname has double slash when 'directory' ends in double slash.
            (Shane Smith)
Solution:   Remove the superfluous slash. (closes #8876)
This commit is contained in:
Bram Moolenaar
2021-10-19 22:12:25 +01:00
parent c5935a859e
commit 8b0e62c93b
3 changed files with 8 additions and 2 deletions

View File

@@ -2064,7 +2064,9 @@ recover_names(
/*
* Need _very_ long file names.
* Append the full path to name with path separators made into percent
* signs, to dir. An unnamed buffer is handled as "" (<currentdir>/"")
* signs, to "dir". An unnamed buffer is handled as "" (<currentdir>/"")
* The last character in "dir" must be an extra slash or backslash, it is
* removed.
*/
char_u *
make_percent_swname(char_u *dir, char_u *name)
@@ -2081,6 +2083,8 @@ make_percent_swname(char_u *dir, char_u *name)
for (d = s; *d != NUL; MB_PTR_ADV(d))
if (vim_ispathsep(*d))
*d = '%';
dir[STRLEN(dir) - 1] = NUL; // remove one trailing slash
d = concat_fnames(dir, s, TRUE);
vim_free(s);
}