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".
diff --git a/src/vim9execute.c b/src/vim9execute.c
index 9f6cc5d..d908e64 100644
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -3313,9 +3313,8 @@
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;