From f52f9ea8f5fb3df51a308c56f2bf66f735ef3ca7 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 27 Jun 2018 20:49:44 +0200 Subject: patch 8.1.0118: duplicate error message for put command Problem: Duplicate error message for put command. Solution: Check return value of u_save(). (Jason Franklin) --- src/ops.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/ops.c') diff --git a/src/ops.c b/src/ops.c index 2dbc74889..73f73d2f9 100644 --- a/src/ops.c +++ b/src/ops.c @@ -3551,9 +3551,10 @@ do_put( return; } - /* Autocommands may be executed when saving lines for undo, which may make - * y_array invalid. Start undo now to avoid that. */ - u_save(curwin->w_cursor.lnum, curwin->w_cursor.lnum + 1); + /* Autocommands may be executed when saving lines for undo. This might + * make "y_array" invalid, so we start undo now to avoid that. */ + if (u_save(curwin->w_cursor.lnum, curwin->w_cursor.lnum + 1) == FAIL) + goto end; if (insert_string != NULL) { -- cgit v1.2.1