Mercurial > vim
comparison src/search.c @ 15089:e428882d6ffb v8.1.0555
patch 8.1.0555: crash when last search pat is set but not last substitute pat
commit https://github.com/vim/vim/commit/2fb8f684d888ad68b283ba8f9505106b5fb725be
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Dec 1 13:14:45 2018 +0100
patch 8.1.0555: crash when last search pat is set but not last substitute pat
Problem: Crash when last search pat is set but not last substitute pat.
Solution: Do not mix up last search pattern and last subtitute pattern.
(closes #3647)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 01 Dec 2018 13:15:04 +0100 |
parents | 70aa5caa9f0d |
children | e8fdc71f3ea0 |
comparison
equal
deleted
inserted
replaced
15088:4460aef12c69 | 15089:e428882d6ffb |
---|---|
1383 { | 1383 { |
1384 char_u *msgbuf; | 1384 char_u *msgbuf; |
1385 char_u *trunc; | 1385 char_u *trunc; |
1386 | 1386 |
1387 if (*searchstr == NUL) | 1387 if (*searchstr == NUL) |
1388 p = spats[last_idx].pat; | 1388 p = spats[0].pat; |
1389 else | 1389 else |
1390 p = searchstr; | 1390 p = searchstr; |
1391 msgbuf = alloc((unsigned)(STRLEN(p) + 40)); | 1391 msgbuf = alloc((unsigned)(STRLEN(p) + 40)); |
1392 if (msgbuf != NULL) | 1392 if (msgbuf != NULL) |
1393 { | 1393 { |