changeset 22965:473a1413d09b v8.2.2029

patch 8.2.2029: Coverity warns for not checking return value Commit: https://github.com/vim/vim/commit/5546688fb6798d37a770f366c13dedfa7e4cb417 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Nov 21 14:16:22 2020 +0100 patch 8.2.2029: Coverity warns for not checking return value Problem: Coverity warns for not checking return value. Solution: Check that u_save_cursor() returns OK.
author Bram Moolenaar <Bram@vim.org>
date Sat, 21 Nov 2020 14:30:04 +0100
parents 59566faad32b
children 0f72b60eee09
files src/ops.c src/version.c
diffstat 2 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/ops.c
+++ b/src/ops.c
@@ -3871,9 +3871,10 @@ do_pending_operator(cmdarg_T *cap, int o
 	    else
 	    {
 		(void)op_delete(oap);
-		if (oap->motion_type == MLINE && has_format_option(FO_AUTO))
-		    u_save_cursor();	    // cursor line wasn't saved yet
-		auto_format(FALSE, TRUE);
+		// save cursor line for undo if it wasn't saved yet
+		if (oap->motion_type == MLINE && has_format_option(FO_AUTO)
+						      && u_save_cursor() == OK)
+		    auto_format(FALSE, TRUE);
 	    }
 	    break;
 
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    2029,
+/**/
     2028,
 /**/
     2027,