patch 9.1.0436: Crash when using '?' as separator for :s
Problem: Crash when using '?' as separator for :s and pattern contains
escaped '?'s (after 9.1.0409).
Solution: Always compute startplen. (zeertzjq).
related: neovim/neovim#28935
closes: 14832
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/testdir/test_substitute.vim b/src/testdir/test_substitute.vim
index cf2c73f..a2367cd 100644
--- a/src/testdir/test_substitute.vim
+++ b/src/testdir/test_substitute.vim
@@ -173,6 +173,16 @@
call feedkeys("Qsc\<CR>y", 'tx')
bwipe!
endfunc
+
+" Test :s with ? as separator.
+func Test_substitute_question_separator()
+ new
+ call setline(1, '??:??')
+ %s?\?\??!!?g
+ call assert_equal('!!:!!', getline(1))
+ bwipe!
+endfunc
+
" Test %s/\n// which is implemented as a special case to use a
" more efficient join rather than doing a regular substitution.
func Test_substitute_join()