diff src/evalwindow.c @ 29175:755ab148288b v8.2.5107

patch 8.2.5107: some callers of rettv_list_alloc() check for not OK Commit: https://github.com/vim/vim/commit/93a1096fe48e12095544924adb267e3b8a16b221 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jun 16 11:42:09 2022 +0100 patch 8.2.5107: some callers of rettv_list_alloc() check for not OK Problem: Some callers of rettv_list_alloc() check for not OK. (Christ van Willegen) Solution: Use "==" instead of "!=" when checking the return value.
author Bram Moolenaar <Bram@vim.org>
date Thu, 16 Jun 2022 12:45:03 +0200
parents d0241e74bfdb
children 827d9f2b7a71
line wrap: on
line diff
--- a/src/evalwindow.c
+++ b/src/evalwindow.c
@@ -471,7 +471,7 @@ f_gettabinfo(typval_T *argvars, typval_T
     dict_T	*d;
     int		tpnr = 0;
 
-    if (rettv_list_alloc(rettv) != OK)
+    if (rettv_list_alloc(rettv) == FAIL)
 	return;
 
     if (in_vim9script() && check_for_opt_number_arg(argvars, 0) == FAIL)
@@ -510,7 +510,7 @@ f_getwininfo(typval_T *argvars, typval_T
     dict_T	*d;
     short	tabnr = 0, winnr;
 
-    if (rettv_list_alloc(rettv) != OK)
+    if (rettv_list_alloc(rettv) == FAIL)
 	return;
 
     if (in_vim9script() && check_for_opt_number_arg(argvars, 0) == FAIL)
@@ -779,7 +779,7 @@ f_win_findbuf(typval_T *argvars, typval_
     if (in_vim9script() && check_for_number_arg(argvars, 0) == FAIL)
 	return;
 
-    if (rettv_list_alloc(rettv) != FAIL)
+    if (rettv_list_alloc(rettv) == OK)
 	win_findbuf(argvars, rettv->vval.v_list);
 }
 
@@ -847,7 +847,7 @@ f_win_id2tabwin(typval_T *argvars, typva
     if (in_vim9script() && check_for_number_arg(argvars, 0) == FAIL)
 	return;
 
-    if (rettv_list_alloc(rettv) != FAIL)
+    if (rettv_list_alloc(rettv) == OK)
 	win_id2tabwin(argvars, rettv->vval.v_list);
 }
 
@@ -1143,7 +1143,7 @@ f_winlayout(typval_T *argvars, typval_T 
 {
     tabpage_T	*tp;
 
-    if (rettv_list_alloc(rettv) != OK)
+    if (rettv_list_alloc(rettv) == FAIL)
 	return;
 
     if (in_vim9script() && check_for_opt_number_arg(argvars, 0) == FAIL)