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
This commit is contained in:
Ingo Klöcker 2022-04-04 13:25:30 +02:00
parent db532eca8e
commit 28cdbfdccb

View File

@ -101,7 +101,7 @@ public:
std::fprintf(ei->debug, "EditInteractor: %u -> nextState( %s, %s ) -> %u\n",
oldState, status_to_string(status), args ? args : "<null>", 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;
}