diff src/eval.c @ 16634:a1ba0bd74e7d v8.1.1319

patch 8.1.1319: computing function length name in many places commit https://github.com/vim/vim/commit/6ed8819822994512c160006bd1204aa11ae3c494 Author: Bram Moolenaar <Bram@vim.org> Date: Sat May 11 18:37:44 2019 +0200 patch 8.1.1319: computing function length name in many places Problem: Computing function length name in many places. Solution: compute name length in call_func().
author Bram Moolenaar <Bram@vim.org>
date Sat, 11 May 2019 18:45:07 +0200
parents 6e87a69b8e0c
children a927fdf9a4b0
line wrap: on
line diff
--- a/src/eval.c
+++ b/src/eval.c
@@ -765,7 +765,7 @@ eval_expr_typval(typval_T *expr, typval_
 	s = expr->vval.v_string;
 	if (s == NULL || *s == NUL)
 	    return FAIL;
-	if (call_func(s, (int)STRLEN(s), rettv, argc, argv, NULL,
+	if (call_func(s, -1, rettv, argc, argv, NULL,
 				     0L, 0L, &dummy, TRUE, NULL, NULL) == FAIL)
 	    return FAIL;
     }
@@ -776,7 +776,7 @@ eval_expr_typval(typval_T *expr, typval_
 	s = partial_name(partial);
 	if (s == NULL || *s == NUL)
 	    return FAIL;
-	if (call_func(s, (int)STRLEN(s), rettv, argc, argv, NULL,
+	if (call_func(s, -1, rettv, argc, argv, NULL,
 				  0L, 0L, &dummy, TRUE, partial, NULL) == FAIL)
 	    return FAIL;
     }
@@ -1088,7 +1088,7 @@ call_vim_function(
     int		ret;
 
     rettv->v_type = VAR_UNKNOWN;		/* clear_tv() uses this */
-    ret = call_func(func, (int)STRLEN(func), rettv, argc, argv, NULL,
+    ret = call_func(func, -1, rettv, argc, argv, NULL,
 		    curwin->w_cursor.lnum, curwin->w_cursor.lnum,
 		    &doesrange, TRUE, NULL, NULL);
     if (ret == FAIL)
@@ -7109,7 +7109,7 @@ handle_subscript(
 	    }
 	    else
 		s = (char_u *)"";
-	    ret = get_func_tv(s, (int)STRLEN(s), rettv, arg,
+	    ret = get_func_tv(s, -1, rettv, arg,
 			curwin->w_cursor.lnum, curwin->w_cursor.lnum,
 			&len, evaluate, pt, selfdict);