1
0
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:
Bram Moolenaar
2013-03-07 16:41:30 +01:00
parent 60abe75379
commit 210f3704f7
2 changed files with 10 additions and 1 deletions

View File

@@ -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)