comparison 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
comparison
equal deleted inserted replaced
16633:d7c2a68c6400 16634:a1ba0bd74e7d
763 if (expr->v_type == VAR_FUNC) 763 if (expr->v_type == VAR_FUNC)
764 { 764 {
765 s = expr->vval.v_string; 765 s = expr->vval.v_string;
766 if (s == NULL || *s == NUL) 766 if (s == NULL || *s == NUL)
767 return FAIL; 767 return FAIL;
768 if (call_func(s, (int)STRLEN(s), rettv, argc, argv, NULL, 768 if (call_func(s, -1, rettv, argc, argv, NULL,
769 0L, 0L, &dummy, TRUE, NULL, NULL) == FAIL) 769 0L, 0L, &dummy, TRUE, NULL, NULL) == FAIL)
770 return FAIL; 770 return FAIL;
771 } 771 }
772 else if (expr->v_type == VAR_PARTIAL) 772 else if (expr->v_type == VAR_PARTIAL)
773 { 773 {
774 partial_T *partial = expr->vval.v_partial; 774 partial_T *partial = expr->vval.v_partial;
775 775
776 s = partial_name(partial); 776 s = partial_name(partial);
777 if (s == NULL || *s == NUL) 777 if (s == NULL || *s == NUL)
778 return FAIL; 778 return FAIL;
779 if (call_func(s, (int)STRLEN(s), rettv, argc, argv, NULL, 779 if (call_func(s, -1, rettv, argc, argv, NULL,
780 0L, 0L, &dummy, TRUE, partial, NULL) == FAIL) 780 0L, 0L, &dummy, TRUE, partial, NULL) == FAIL)
781 return FAIL; 781 return FAIL;
782 } 782 }
783 else 783 else
784 { 784 {
1086 { 1086 {
1087 int doesrange; 1087 int doesrange;
1088 int ret; 1088 int ret;
1089 1089
1090 rettv->v_type = VAR_UNKNOWN; /* clear_tv() uses this */ 1090 rettv->v_type = VAR_UNKNOWN; /* clear_tv() uses this */
1091 ret = call_func(func, (int)STRLEN(func), rettv, argc, argv, NULL, 1091 ret = call_func(func, -1, rettv, argc, argv, NULL,
1092 curwin->w_cursor.lnum, curwin->w_cursor.lnum, 1092 curwin->w_cursor.lnum, curwin->w_cursor.lnum,
1093 &doesrange, TRUE, NULL, NULL); 1093 &doesrange, TRUE, NULL, NULL);
1094 if (ret == FAIL) 1094 if (ret == FAIL)
1095 clear_tv(rettv); 1095 clear_tv(rettv);
1096 1096
7107 else 7107 else
7108 s = functv.vval.v_string; 7108 s = functv.vval.v_string;
7109 } 7109 }
7110 else 7110 else
7111 s = (char_u *)""; 7111 s = (char_u *)"";
7112 ret = get_func_tv(s, (int)STRLEN(s), rettv, arg, 7112 ret = get_func_tv(s, -1, rettv, arg,
7113 curwin->w_cursor.lnum, curwin->w_cursor.lnum, 7113 curwin->w_cursor.lnum, curwin->w_cursor.lnum,
7114 &len, evaluate, pt, selfdict); 7114 &len, evaluate, pt, selfdict);
7115 7115
7116 /* Clear the funcref afterwards, so that deleting it while 7116 /* Clear the funcref afterwards, so that deleting it while
7117 * evaluating the arguments is possible (see test55). */ 7117 * evaluating the arguments is possible (see test55). */