]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.851 v7.3.851
authorBram Moolenaar <Bram@vim.org>
Thu, 7 Mar 2013 15:41:30 +0000 (16:41 +0100)
committerBram Moolenaar <Bram@vim.org>
Thu, 7 Mar 2013 15:41:30 +0000 (16:41 +0100)
Problem:    Using an empty pattern with :sort silently continues when there is
            no previous search pattern.
Solution:   Give an error message.

src/ex_cmds.c
src/version.c

index c7135a3d7b742e0ac69d0b497d181f6c3703cded..d6bd0ebeb5baacc8b9f63b9aba9ef45f7913dcdb 100644 (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)
index b4234e0a361efcf35a65cb02c442e989a648e807..97fdd990cadf2105ad4d97218f4689ceebc18844 100644 (file)
@@ -728,6 +728,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    851,
 /**/
     850,
 /**/