diff options
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 10 |
1 files changed, 10 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++; |