To: vim_dev@googlegroups.com Subject: Patch 8.2.4535 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.4535 Problem: Filename modifer ":8" removes the filename. Solution: Use strncpy() instead of vim_strncpy(). (Christian Brabandt, closes #9918, closes #8600) Files: src/filepath.c, src/testdir/test_shortpathname.vim *** ../vim-8.2.4534/src/filepath.c 2022-02-19 11:19:29.821776577 +0000 --- src/filepath.c 2022-03-10 11:51:27.773748021 +0000 *************** *** 186,192 **** // unless get_short_pathname() did its work in-place. *fname = *bufp = save_fname; if (short_fname != save_fname) ! vim_strncpy(save_fname, short_fname, len); save_fname = NULL; } --- 186,192 ---- // unless get_short_pathname() did its work in-place. *fname = *bufp = save_fname; if (short_fname != save_fname) ! STRNCPY(save_fname, short_fname, len); save_fname = NULL; } *** ../vim-8.2.4534/src/testdir/test_shortpathname.vim 2020-08-12 17:50:31.887655765 +0100 --- src/testdir/test_shortpathname.vim 2022-03-10 11:51:27.773748021 +0000 *************** *** 88,91 **** --- 88,96 ---- call delete(dir, 'd') endfunc + func Test_ColonEight_notexists() + let non_exists='C:\windows\newfile.txt' + call assert_equal(non_exists, fnamemodify(non_exists, ':p:8')) + endfunc + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.4534/src/version.c 2022-03-10 12:20:48.542552970 +0000 --- src/version.c 2022-03-10 12:23:43.622187660 +0000 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 4535, /**/ -- How do I set the laser printer to stun? /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///