comparison src/eval.c @ 3108:8aca621c0091 v7.3.325

updated for version 7.3.325 Problem: A duplicated function argument gives an internal error. Solution: Give a proper error message. (based on patch by Tyru)
author Bram Moolenaar <bram@vim.org>
date Fri, 30 Sep 2011 16:39:48 +0200
parents 2cbde6bcc623
children ec901ddc84d5
comparison
equal deleted inserted replaced
3107:f7ebebb469b6 3108:8aca621c0091
20459 void 20459 void
20460 ex_function(eap) 20460 ex_function(eap)
20461 exarg_T *eap; 20461 exarg_T *eap;
20462 { 20462 {
20463 char_u *theline; 20463 char_u *theline;
20464 int i;
20464 int j; 20465 int j;
20465 int c; 20466 int c;
20466 int saved_did_emsg; 20467 int saved_did_emsg;
20467 char_u *name = NULL; 20468 char_u *name = NULL;
20468 char_u *p; 20469 char_u *p;
20705 c = *p; 20706 c = *p;
20706 *p = NUL; 20707 *p = NUL;
20707 arg = vim_strsave(arg); 20708 arg = vim_strsave(arg);
20708 if (arg == NULL) 20709 if (arg == NULL)
20709 goto erret; 20710 goto erret;
20711
20712 /* Check for duplicate argument name. */
20713 for (i = 0; i < newargs.ga_len; ++i)
20714 if (STRCMP(((char_u **)(newargs.ga_data))[i], arg) == 0)
20715 {
20716 EMSG2(_("E853: Duplicate argument name: %s"), arg);
20717 goto erret;
20718 }
20719
20710 ((char_u **)(newargs.ga_data))[newargs.ga_len] = arg; 20720 ((char_u **)(newargs.ga_data))[newargs.ga_len] = arg;
20711 *p = c; 20721 *p = c;
20712 newargs.ga_len++; 20722 newargs.ga_len++;
20713 if (*p == ',') 20723 if (*p == ',')
20714 ++p; 20724 ++p;