Patch 8.2.3543
Problem:    Swapname has double slash when 'directory' ends in double slash.
            (Shane Smith)
Solution:   Remove the superfluous slash. (closes #8876)
Files:      src/memline.c, src/testdir/test_swap.vim


*** ../vim-8.2.3542/src/memline.c       2021-10-14 21:27:50.646253845 +0100
--- src/memline.c       2021-10-19 22:10:52.031440183 +0100
***************
*** 2064,2070 ****
  /*
   * 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>/"")
   */
      char_u *
  make_percent_swname(char_u *dir, char_u *name)
--- 2064,2072 ----
  /*
   * 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>/"")
!  * 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,2086 ****
--- 2083,2090 ----
            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);
        }
*** ../vim-8.2.3542/src/testdir/test_swap.vim   2021-07-10 16:59:44.679330992 
+0100
--- src/testdir/test_swap.vim   2021-10-19 22:10:06.606882181 +0100
***************
*** 410,416 ****
  
    " Check that this also works when 'directory' ends with '//'
    edit Xtestlink
!   call assert_match('Xtestfile\.swp$', s:swapname())
    bwipe!
  
    set dir&
--- 410,416 ----
  
    " Check that this also works when 'directory' ends with '//'
    edit Xtestlink
!   call assert_match('Xswapdir[/\\]%.*testdir%Xtestfile\.swp$', s:swapname())
    bwipe!
  
    set dir&
*** ../vim-8.2.3542/src/version.c       2021-10-19 20:48:48.448911779 +0100
--- src/version.c       2021-10-19 22:10:22.347073971 +0100
***************
*** 759,760 ****
--- 759,762 ----
  {   /* Add new patch number below this line */
+ /**/
+     3543,
  /**/

-- 
panic("Foooooooood fight!");
        -- In the kernel source aha1542.c, after detecting a bad segment list

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20211019211254.E8C08C80053%40moolenaar.net.

Raspunde prin e-mail lui