From 28cdbfdccb347e1ef15f794d4afd36f9275f073c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ingo=20Kl=C3=B6cker?= Date: Mon, 4 Apr 2022 13:25:30 +0200 Subject: [PATCH] cpp: Handle canceling of an edit operation * lang/cpp/src/editinteractor.cpp (CallbackHelper::edit_interactor_callback_impl): Check for error _or_ canceled state. -- Without this canceling an edit operation resulted in a "General error". GnuPG-bug-id: 5904 --- lang/cpp/src/editinteractor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lang/cpp/src/editinteractor.cpp b/lang/cpp/src/editinteractor.cpp index 753c2b09..08cb1bc9 100644 --- a/lang/cpp/src/editinteractor.cpp +++ b/lang/cpp/src/editinteractor.cpp @@ -101,7 +101,7 @@ public: std::fprintf(ei->debug, "EditInteractor: %u -> nextState( %s, %s ) -> %u\n", oldState, status_to_string(status), args ? args : "", ei->state); } - if (err) { + if (err || err.isCanceled()) { ei->state = oldState; goto error; } @@ -154,7 +154,7 @@ public: } error: - if (err) { + if (err || err.isCanceled()) { ei->error = err; ei->state = EditInteractor::ErrorState; }