summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2011-09-30 16:39:48 +0200
committerBram Moolenaar <Bram@vim.org>2011-09-30 16:39:48 +0200
commitacd6a049f68d0a69a96240c2d928a7ddda9c4c69 (patch)
treec20e9c2145a5de909c0bf5ea50868b38e3fbda53
parenta627c96182e4f442909c3450d359aa4f59946fde (diff)
downloadvim-git-acd6a049f68d0a69a96240c2d928a7ddda9c4c69.tar.gz
updated for version 7.3.325v7.3.325
Problem: A duplicated function argument gives an internal error. Solution: Give a proper error message. (based on patch by Tyru)
-rw-r--r--src/eval.c10
-rw-r--r--src/version.c2
2 files changed, 12 insertions, 0 deletions
diff --git a/src/eval.c b/src/eval.c
index 6e8c26f4a..780ed9eca 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -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++;
diff --git a/src/version.c b/src/version.c
index 854cb9c71..96f2ee49a 100644
--- a/src/version.c
+++ b/src/version.c
@@ -710,6 +710,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 325,
+/**/
324,
/**/
323,