forked from aniani/vim
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.
This commit is contained in:
@@ -415,8 +415,15 @@ ex_sort(eap)
|
||||
}
|
||||
*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)
|
||||
|
||||
Reference in New Issue
Block a user