To: vim-dev@vim.org Subject: Patch 6.1.218 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.1.218 Problem: No error message for using the function argument "5+". (Servatius Brandt) Solution: Give an error message if a function or variable is expected but is not found. Files: src/eval.c *** ../vim61.217/src/eval.c Mon Oct 7 20:47:47 2002 --- src/eval.c Fri Oct 11 19:44:18 2002 *************** *** 966,971 **** --- 966,973 ---- name = arg; len = get_func_len(&arg, &alias); + if (len == 0) + goto end; if (alias != NULL) name = alias; *************** *** 1019,1025 **** end: if (alias != NULL) vim_free(alias); - } /* --- 1021,1026 ---- *************** *** 1939,1945 **** if (alias != NULL) s = alias; ! if (len != 0) { if (**arg == '(') /* recursive! */ ret = get_func_var(s, len, retvar, arg, --- 1940,1948 ---- if (alias != NULL) s = alias; ! if (len == 0) ! ret = FAIL; ! else { if (**arg == '(') /* recursive! */ ret = get_func_var(s, len, retvar, arg, *************** *** 1948,1955 **** else if (evaluate) ret = get_var_var(s, len, retvar); } - else - ret = FAIL; if (alias != NULL) vim_free(alias); --- 1951,1956 ---- *************** *** 2648,2654 **** break; if (eval1(&argp, &argvars[argcount], evaluate) == FAIL) { ! error = ERROR_OTHER; break; } ++argcount; --- 2649,2655 ---- break; if (eval1(&argp, &argvars[argcount], evaluate) == FAIL) { ! error = ERROR_INVARG; break; } ++argcount; *************** *** 6679,6694 **** * Thus the -len here. */ temp_string = make_expanded_name(*arg - len, expr_start, expr_end, p); ! if (temp_string != NULL) ! { ! *alias = temp_string; ! *arg = skipwhite(p); ! return (int)STRLEN(temp_string); ! } } #endif ! return get_id_len(arg) + len; } static char_u * --- 6680,6698 ---- * Thus the -len here. */ temp_string = make_expanded_name(*arg - len, expr_start, expr_end, p); ! if (temp_string == NULL) ! return 0; ! *alias = temp_string; ! *arg = skipwhite(p); ! return (int)STRLEN(temp_string); } #endif ! len += get_id_len(arg); ! if (len == 0) ! EMSG2(_(e_invexpr2), *arg); ! ! return len; } static char_u * *** ../vim61.217/src/version.c Sat Oct 12 17:26:38 2002 --- src/version.c Sat Oct 12 21:14:23 2002 *************** *** 608,609 **** --- 608,611 ---- { /* Add new patch number below this line */ + /**/ + 218, /**/ -- hundred-and-one symptoms of being an internet addict: 207. You're given one phone call in prison and you ask them for a laptop. /// Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net \\\ /// Creator of Vim - Vi IMproved -- http://www.vim.org \\\ \\\ Project leader for A-A-P -- http://www.a-a-p.org /// \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///