Mercurial > vim
comparison src/evalfunc.c @ 9717:6226de5f8137 v7.4.2134
commit https://github.com/vim/vim/commit/b54c3ff3174dbb5dfbfcabdf95200b047beaa644
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jul 31 14:11:58 2016 +0200
patch 7.4.2134
Problem: No error for using function() badly.
Solution: Check for passing wrong function name. (Ken Takata)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 31 Jul 2016 14:15:05 +0200 |
parents | be4aaef2651c |
children | 80ac9cf77c9b |
comparison
equal
deleted
inserted
replaced
9716:f294f224b8fc | 9717:6226de5f8137 |
---|---|
2843 if (*skipwhite(p) != NUL) | 2843 if (*skipwhite(p) != NUL) |
2844 n = FALSE; /* trailing garbage */ | 2844 n = FALSE; /* trailing garbage */ |
2845 } | 2845 } |
2846 else if (*p == '*') /* internal or user defined function */ | 2846 else if (*p == '*') /* internal or user defined function */ |
2847 { | 2847 { |
2848 n = function_exists(p + 1); | 2848 n = function_exists(p + 1, FALSE); |
2849 } | 2849 } |
2850 else if (*p == ':') | 2850 else if (*p == ':') |
2851 { | 2851 { |
2852 n = cmd_exists(p + 1); | 2852 n = cmd_exists(p + 1); |
2853 } | 2853 } |
3575 | 3575 |
3576 if (s == NULL || *s == NUL || (use_string && VIM_ISDIGIT(*s))) | 3576 if (s == NULL || *s == NUL || (use_string && VIM_ISDIGIT(*s))) |
3577 EMSG2(_(e_invarg2), s); | 3577 EMSG2(_(e_invarg2), s); |
3578 /* Don't check an autoload name for existence here. */ | 3578 /* Don't check an autoload name for existence here. */ |
3579 else if (use_string && vim_strchr(s, AUTOLOAD_CHAR) == NULL | 3579 else if (use_string && vim_strchr(s, AUTOLOAD_CHAR) == NULL |
3580 && !function_exists(s)) | 3580 && !function_exists(s, TRUE)) |
3581 EMSG2(_("E700: Unknown function: %s"), s); | 3581 EMSG2(_("E700: Unknown function: %s"), s); |
3582 else | 3582 else |
3583 { | 3583 { |
3584 int dict_idx = 0; | 3584 int dict_idx = 0; |
3585 int arg_idx = 0; | 3585 int arg_idx = 0; |