diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/regexp.c | 4 | ||||
-rw-r--r-- | src/testdir/test_substitute.vim | 10 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 13 insertions, 3 deletions
diff --git a/src/regexp.c b/src/regexp.c index d431932191..147452aae2 100644 --- a/src/regexp.c +++ b/src/regexp.c @@ -620,6 +620,7 @@ skip_regexp_ex( { magic_T mymagic; char_u *p = startp; + size_t startplen = STRLEN(startp); if (magic) mymagic = MAGIC_ON; @@ -642,12 +643,9 @@ skip_regexp_ex( { if (dirc == '?' && newp != NULL && p[1] == '?') { - size_t startplen = 0; - // change "\?" to "?", make a copy first. if (*newp == NULL) { - startplen = STRLEN(startp); *newp = vim_strnsave(startp, startplen); if (*newp != NULL) p = *newp + (p - startp); diff --git a/src/testdir/test_substitute.vim b/src/testdir/test_substitute.vim index cf2c73fb95..a2367cd233 100644 --- a/src/testdir/test_substitute.vim +++ b/src/testdir/test_substitute.vim @@ -173,6 +173,16 @@ func Test_substitute_repeat() 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() diff --git a/src/version.c b/src/version.c index de9afee33f..98ec4754e5 100644 --- a/src/version.c +++ b/src/version.c @@ -705,6 +705,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 436, +/**/ 435, /**/ 434, |