1
0
forked from aniani/vim

patch 9.1.0615: Unnecessary STRLEN() in make_percent_swname()

Problem:  Unnecessary STRLEN() in make_percent_swname()
Solution: Pass the end of "dir" to make_percent_swname()
          (zeertzjq)

closes: #15340

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
zeertzjq
2024-07-25 20:58:42 +02:00
committed by Christian Brabandt
parent 4d68054c1e
commit 242667ae14
4 changed files with 9 additions and 7 deletions

View File

@@ -1350,7 +1350,7 @@ buf_write(
p = copybuf + STRLEN(copybuf);
if (after_pathsep(copybuf, p) && p[-1] == p[-2])
// Ends with '//', use full path
if ((p = make_percent_swname(copybuf, fname)) != NULL)
if ((p = make_percent_swname(copybuf, p, fname)) != NULL)
{
backup = modname(p, backup_ext, FALSE);
vim_free(p);
@@ -1564,7 +1564,7 @@ buf_write(
p = IObuff + STRLEN(IObuff);
if (after_pathsep(IObuff, p) && p[-1] == p[-2])
// path ends with '//', use full path
if ((p = make_percent_swname(IObuff, fname)) != NULL)
if ((p = make_percent_swname(IObuff, p, fname)) != NULL)
{
backup = modname(p, backup_ext, FALSE);
vim_free(p);