summaryrefslogtreecommitdiffstats
path: root/src/ex_getln.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-20 03:56:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-20 03:56:58 +0000
commit0f75b2ad2e23107f8112b6dcd4785eeef6cc34aa (patch)
tree25185226a8d172d94b0ff72f5a611659252c76d6 /src/ex_getln.c
parentReleasing progress-linux version 2:9.1.0377-1~progress7.99u1. (diff)
downloadvim-0f75b2ad2e23107f8112b6dcd4785eeef6cc34aa.tar.xz
vim-0f75b2ad2e23107f8112b6dcd4785eeef6cc34aa.zip
Merging upstream version 2:9.1.0496.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/ex_getln.c')
-rw-r--r--src/ex_getln.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/ex_getln.c b/src/ex_getln.c
index 1731d29..3ae4958 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -493,7 +493,7 @@ may_do_incsearch_highlighting(
sia.sa_tm = 500;
#endif
found = do_search(NULL, firstc == ':' ? '/' : firstc, search_delim,
- ccline.cmdbuff + skiplen, count, search_flags,
+ ccline.cmdbuff + skiplen, patlen, count, search_flags,
#ifdef FEAT_RELTIME
&sia
#else
@@ -654,7 +654,7 @@ may_adjust_incsearch_highlighting(
pat[patlen] = NUL;
i = searchit(curwin, curbuf, &t, NULL,
c == Ctrl_G ? FORWARD : BACKWARD,
- pat, count, search_flags, RE_SEARCH, NULL);
+ pat, patlen, count, search_flags, RE_SEARCH, NULL);
--emsg_off;
pat[patlen] = save;
if (i)
@@ -2539,12 +2539,14 @@ returncmd:
if (ccline.cmdlen && firstc != NUL
&& (some_key_typed || histype == HIST_SEARCH))
{
- add_to_history(histype, ccline.cmdbuff, TRUE,
+ size_t cmdbufflen = STRLEN(ccline.cmdbuff);
+
+ add_to_history(histype, ccline.cmdbuff, cmdbufflen, TRUE,
histype == HIST_SEARCH ? firstc : NUL);
if (firstc == ':')
{
vim_free(new_last_cmdline);
- new_last_cmdline = vim_strsave(ccline.cmdbuff);
+ new_last_cmdline = vim_strnsave(ccline.cmdbuff, cmdbufflen);
}
}