Mercurial > vim
annotate runtime/ftplugin/readline.vim @ 33132:811555b5ab8b v9.0.1848
patch 9.0.1848: [security] buffer-overflow in vim_regsub_both()
Commit: https://github.com/vim/vim/commit/ced2c7394aafdc90fb7845e09b3a3fee23d48cb1
Author: Christian Brabandt <cb@256bit.org>
Date: Sat Sep 2 21:15:52 2023 +0200
patch 9.0.1848: [security] buffer-overflow in vim_regsub_both()
Problem: buffer-overflow in vim_regsub_both()
Solution: Check remaining space
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 02 Sep 2023 21:45:03 +0200 |
parents | 5510af40c77b |
children | 0d460c34ee39 |
rev | line source |
---|---|
375 | 1 " Vim filetype plugin file |
31430 | 2 " Language: readline(3) configuration file |
3 " Maintainer: Doug Kearns <dougkearns@gmail.com> | |
4 " Previous Maintainer: Nikolai Weibull <now@bitwi.se> | |
5 " Last Change: 2022 Dec 09 | |
375 | 6 |
7 if exists("b:did_ftplugin") | |
8 finish | |
9 endif | |
10 let b:did_ftplugin = 1 | |
11 | |
1698 | 12 let s:cpo_save = &cpo |
13 set cpo&vim | |
14 | |
31430 | 15 setlocal comments=:# |
16 setlocal commentstring=#\ %s | |
17 setlocal formatoptions-=t formatoptions+=croql | |
18 | |
389 | 19 let b:undo_ftplugin = "setl com< cms< fo<" |
375 | 20 |
31430 | 21 if exists("loaded_matchit") && !exists("b:match_words") |
22 let b:match_ignorecase = 0 | |
23 let b:match_words = '$if:$else:$endif' | |
24 let b:undo_ftplugin ..= " | unlet! b:match_ignorecase b:match_words" | |
25 endif | |
26 | |
27 if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") | |
32984 | 28 let b:browsefilter = "Readline Initialization Files (inputrc .inputrc)\tinputrc;*.inputrc\n" .. |
31430 | 29 \ "All Files (*.*)\t*.*\n" |
30 let b:undo_ftplugin ..= " | unlet! b:browsefilter" | |
31 endif | |
1698 | 32 |
32984 | 33 if has('unix') && executable('less') |
34 if !has('gui_running') | |
35 command -buffer -nargs=1 Sman | |
36 \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s+' . <q-args> . '\b'' --hilite-search" man ' . '3 readline' | | |
37 \ redraw! | |
38 elseif has('terminal') | |
39 command -buffer -nargs=1 Sman | |
40 \ silent exe 'term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . '3 readline' | |
41 endif | |
42 if exists(':Sman') == 2 | |
43 setlocal iskeyword+=- | |
44 setlocal keywordprg=:Sman | |
33074
5510af40c77b
runtime: cleanup :Sman command via the undo_ftplugin mechanism (#12967)
Christian Brabandt <cb@256bit.org>
parents:
32984
diff
changeset
|
45 let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer Sman' |
32984 | 46 endif |
47 endif | |
48 | |
1698 | 49 let &cpo = s:cpo_save |
50 unlet s:cpo_save | |
31430 | 51 |
52 " vim: nowrap sw=2 sts=2 ts=8 noet: |