updated for version 7.3.851
Problem: Using an empty pattern with :sort silently continues when there is
no previous search pattern.
Solution: Give an error message.
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index c7135a3..d6bd0eb 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -415,8 +415,15 @@
}
*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)