0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.4534: Vim9: "is" operator with empty string and null returns true

Problem:    Vim9: "is" operator with empty string and null returns true.
Solution:   Consider empty string and null to be different for "is".
This commit is contained in:
Bram Moolenaar
2022-03-10 12:20:53 +00:00
parent 56b84b1728
commit f8691004b0
4 changed files with 27 additions and 5 deletions

View File

@@ -3313,9 +3313,8 @@ exec_instructions(ectx_T *ectx)
break;
default:
tv->v_type = VAR_STRING;
tv->vval.v_string = vim_strsave(
iptr->isn_arg.string == NULL
? (char_u *)"" : iptr->isn_arg.string);
tv->vval.v_string = iptr->isn_arg.string == NULL
? NULL : vim_strsave(iptr->isn_arg.string);
}
break;