Problem: Using an empty pattern with :sort silently continues when there is
no previous search pattern.
Solution: Give an error message.
}
*s = NUL;
/* Use last search pattern if sort pattern is empty. */
- if (s == p + 1 && last_search_pat() != NULL)
+ if (s == p + 1)
+ {
+ if (last_search_pat() == NULL)
+ {
+ EMSG(_(e_noprevre));
+ goto sortend;
+ }
regmatch.regprog = vim_regcomp(last_search_pat(), RE_MAGIC);
+ }
else
regmatch.regprog = vim_regcomp(p + 1, RE_MAGIC);
if (regmatch.regprog == NULL)
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 851,
/**/
850,
/**/