]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.325 v7.3.325
authorBram Moolenaar <Bram@vim.org>
Fri, 30 Sep 2011 14:39:48 +0000 (16:39 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 30 Sep 2011 14:39:48 +0000 (16:39 +0200)
Problem:    A duplicated function argument gives an internal error.
Solution:   Give a proper error message. (based on patch by Tyru)

src/eval.c
src/version.c

index 6e8c26f4a76afefc3880390ad13ecfa363efa137..780ed9eca0f7ffd99d6e599a10dabff9b52de808 100644 (file)
@@ -20461,6 +20461,7 @@ ex_function(eap)
     exarg_T    *eap;
 {
     char_u     *theline;
+    int                i;
     int                j;
     int                c;
     int                saved_did_emsg;
@@ -20707,6 +20708,15 @@ ex_function(eap)
            arg = vim_strsave(arg);
            if (arg == NULL)
                goto erret;
+
+           /* Check for duplicate argument name. */
+           for (i = 0; i < newargs.ga_len; ++i)
+               if (STRCMP(((char_u **)(newargs.ga_data))[i], arg) == 0)
+               {
+                   EMSG2(_("E853: Duplicate argument name: %s"), arg);
+                   goto erret;
+               }
+
            ((char_u **)(newargs.ga_data))[newargs.ga_len] = arg;
            *p = c;
            newargs.ga_len++;
index 854cb9c716de027f28b4de2f7bbaa67939e65a83..96f2ee49aa656c4bc7bb4f773e79d46c51ef7cff 100644 (file)
@@ -709,6 +709,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    325,
 /**/
     324,
 /**/