comparison src/vim9compile.c @ 28780:acca2214cabf v8.2.4914

patch 8.2.4914: string interpolation in :def function may fail Commit: https://github.com/vim/vim/commit/933c2922b5e81b238c2e56361c76cf7c9548a2d7 Author: Bram Moolenaar <Bram@vim.org> Date: Sun May 8 16:37:07 2022 +0100 patch 8.2.4914: string interpolation in :def function may fail Problem: String interpolation in :def function may fail. Solution: Do not terminate the expression. (closes https://github.com/vim/vim/issues/10377)
author Bram Moolenaar <Bram@vim.org>
date Sun, 08 May 2022 17:45:02 +0200
parents fb86364889a4
children d0241e74bfdb
comparison
equal deleted inserted replaced
28779:4185037f5051 28780:acca2214cabf
979 int 979 int
980 compile_all_expr_in_str(char_u *str, int evalstr, cctx_T *cctx) 980 compile_all_expr_in_str(char_u *str, int evalstr, cctx_T *cctx)
981 { 981 {
982 char_u *p = str; 982 char_u *p = str;
983 char_u *val; 983 char_u *val;
984 char_u save_c;
985 int count = 0; 984 int count = 0;
986 985
987 if (cctx->ctx_skip == SKIP_YES) 986 if (cctx->ctx_skip == SKIP_YES)
988 return OK; 987 return OK;
989 988
1049 if (*block_end != '}') 1048 if (*block_end != '}')
1050 { 1049 {
1051 semsg(_(e_missing_close_curly_str), str); 1050 semsg(_(e_missing_close_curly_str), str);
1052 return FAIL; 1051 return FAIL;
1053 } 1052 }
1054 save_c = *block_end;
1055 *block_end = NUL;
1056 if (compile_expr0(&block_start, cctx) == FAIL) 1053 if (compile_expr0(&block_start, cctx) == FAIL)
1057 return FAIL; 1054 return FAIL;
1058 *block_end = save_c;
1059 may_generate_2STRING(-1, TRUE, cctx); 1055 may_generate_2STRING(-1, TRUE, cctx);
1060 ++count; 1056 ++count;
1061 1057
1062 p = block_end + 1; 1058 p = block_end + 1;
1063 } 1059 }