}
}
else if (*p == '&' || *p == '+') /* option */
+ {
n = (get_option_tv(&p, NULL, TRUE) == OK);
+ if (*skipwhite(p) != NUL)
+ n = FALSE; /* trailing garbage */
+ }
else if (*p == '*') /* internal or user defined function */
{
n = function_exists(p + 1);
clear_tv(&tv);
}
}
+ if (*p != NUL)
+ n = FALSE;
vim_free(tofree);
}
int n = FALSE;
p = trans_function_name(&nm, FALSE, TFN_INT|TFN_QUIET, NULL);
- if (p != NULL)
+ nm = skipwhite(nm);
+
+ /* Only accept "funcname", "funcname ", "funcname (..." and
+ * "funcname(...", not "funcname!...". */
+ if (p != NULL && (*nm == NUL || *nm == '('))
{
if (builtin_function(p))
n = (find_internal_func(p) >= 0);
else
n = (find_func(p) != NULL);
- vim_free(p);
}
+ vim_free(p);
return n;
}