diff options
author | Bram Moolenaar <Bram@vim.org> | 2013-03-07 16:41:30 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2013-03-07 16:41:30 +0100 |
commit | 210f3704f795870c513a136725718e10ac2bdbfc (patch) | |
tree | 0050c17ba6dd4164be1f8d8047d5fdcfbb3d08af | |
parent | 60abe75379f8b7c2076856c5f12ce2e7650110f6 (diff) | |
download | vim-git-210f3704f795870c513a136725718e10ac2bdbfc.tar.gz |
updated for version 7.3.851v7.3.851
Problem: Using an empty pattern with :sort silently continues when there is
no previous search pattern.
Solution: Give an error message.
-rw-r--r-- | src/ex_cmds.c | 9 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c index c7135a3d7..d6bd0ebeb 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -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) diff --git a/src/version.c b/src/version.c index b4234e0a3..97fdd990c 100644 --- a/src/version.c +++ b/src/version.c @@ -729,6 +729,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 851, +/**/ 850, /**/ 849, |