diff src/search.c @ 10172:ab45de65977b v7.4.2356

commit https://github.com/vim/vim/commit/ea683da58cf9ecf3afab9d650d3d2da76e5298d3 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Sep 9 21:41:34 2016 +0200 patch 7.4.2356 Problem: Reading past end of line when using previous substitute pattern. (Dominique Pelle) Solution: Don't set "pat" only set "searchstr".
author Christian Brabandt <cb@256bit.org>
date Fri, 09 Sep 2016 21:45:05 +0200
parents 793471c09a4b
children 154d5a2e7395
line wrap: on
line diff
--- a/src/search.c
+++ b/src/search.c
@@ -1240,14 +1240,13 @@ do_search(
 	{
 	    if (spats[RE_SEARCH].pat == NULL)	    /* no previous pattern */
 	    {
-		pat = spats[RE_SUBST].pat;
-		if (pat == NULL)
+		searchstr = spats[RE_SUBST].pat;
+		if (searchstr == NULL)
 		{
 		    EMSG(_(e_noprevre));
 		    retval = 0;
 		    goto end_do_search;
 		}
-		searchstr = pat;
 	    }
 	    else
 	    {