Mercurial > vim
comparison src/list.c @ 22121:b50610a6aee0 v8.2.1610
patch 8.2.1610: Vim9: cannot pass "true" to list2str() and str2list()
Commit: https://github.com/vim/vim/commit/a48f786787e8e070c1a611146fd1f0f7e141e60a
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Sep 5 20:16:57 2020 +0200
patch 8.2.1610: Vim9: cannot pass "true" to list2str() and str2list()
Problem: Vim9: cannot pass "true" to list2str() and str2list().
Solution: Use tv_get_bool_chk(). (closes https://github.com/vim/vim/issues/6877)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 05 Sep 2020 20:30:03 +0200 |
parents | 4bc644f4dd2d |
children | 07e48ee8c3bb |
comparison
equal
deleted
inserted
replaced
22120:70629b7d2db5 | 22121:b50610a6aee0 |
---|---|
1395 l = argvars[0].vval.v_list; | 1395 l = argvars[0].vval.v_list; |
1396 if (l == NULL) | 1396 if (l == NULL) |
1397 return; // empty list results in empty string | 1397 return; // empty list results in empty string |
1398 | 1398 |
1399 if (argvars[1].v_type != VAR_UNKNOWN) | 1399 if (argvars[1].v_type != VAR_UNKNOWN) |
1400 utf8 = (int)tv_get_number_chk(&argvars[1], NULL); | 1400 utf8 = (int)tv_get_bool_chk(&argvars[1], NULL); |
1401 | 1401 |
1402 CHECK_LIST_MATERIALIZE(l); | 1402 CHECK_LIST_MATERIALIZE(l); |
1403 ga_init2(&ga, 1, 80); | 1403 ga_init2(&ga, 1, 80); |
1404 if (has_mbyte || utf8) | 1404 if (has_mbyte || utf8) |
1405 { | 1405 { |