Mercurial > vim
comparison src/testdir/test_vimscript.vim @ 29305:949e8978ea43 v8.2.5169
patch 8.2.5169: nested :source may use NULL pointer
Commit: https://github.com/vim/vim/commit/79481367a457951aabd9501b510fd7e3eb29c3d8
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Jun 27 20:15:10 2022 +0100
patch 8.2.5169: nested :source may use NULL pointer
Problem: Nested :source may use NULL pointer.
Solution: Do not use the NULL pointer.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 27 Jun 2022 21:30:03 +0200 |
parents | c428a4e53b9c |
children | 029c59bf78f1 |
comparison
equal
deleted
inserted
replaced
29304:584ebb01e999 | 29305:949e8978ea43 |
---|---|
7526 let res ..= c .. '-' | 7526 let res ..= c .. '-' |
7527 endfor | 7527 endfor |
7528 call assert_equal('', res) | 7528 call assert_equal('', res) |
7529 endfunc | 7529 endfunc |
7530 | 7530 |
7531 " Test for deeply nested :source command {{{1 | |
7532 func Test_deeply_nested_source() | |
7533 let lines =<< trim END | |
7534 | |
7535 so | |
7536 sil 0scr | |
7537 delete | |
7538 so | |
7539 0 | |
7540 END | |
7541 call writefile(["vim9 silent! @0 \n/"] + lines, 'Xnested.vim') | |
7542 | |
7543 " this must not crash | |
7544 let cmd = GetVimCommand() .. " -e -s -S Xnested.vim -c qa!" | |
7545 call system(cmd) | |
7546 | |
7547 call delete('Xnested.vim') | |
7548 endfunc | |
7549 | |
7531 "------------------------------------------------------------------------------- | 7550 "------------------------------------------------------------------------------- |
7532 " Modelines {{{1 | 7551 " Modelines {{{1 |
7533 " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker | 7552 " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker |
7534 "------------------------------------------------------------------------------- | 7553 "------------------------------------------------------------------------------- |