diff src/evalfunc.c @ 25244:11ed1f0adb01 v8.2.3158

patch 8.2.3158: strange error message when using islocked() with a number Commit: https://github.com/vim/vim/commit/1840a7b4e3577e617f724c9d07ccc78195cc010a Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jul 13 20:32:29 2021 +0200 patch 8.2.3158: strange error message when using islocked() with a number Problem: Strange error message when using islocked() with a number. (Yegappan Lakshmanan) Solution: Check that the name is empty.
author Bram Moolenaar <Bram@vim.org>
date Tue, 13 Jul 2021 20:45:03 +0200
parents 2c83f7b316d3
children acda780ffc3e
line wrap: on
line diff
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -5961,7 +5961,10 @@ f_islocked(typval_T *argvars, typval_T *
     if (end != NULL && lv.ll_name != NULL)
     {
 	if (*end != NUL)
-	    semsg(_(e_trailing_arg), end);
+	{
+	    semsg(_(lv.ll_name == lv.ll_name_end
+					   ? e_invarg2 : e_trailing_arg), end);
+	}
 	else
 	{
 	    if (lv.ll_tv == NULL)