diff options
author | Werner Koch <[email protected]> | 2016-09-15 07:24:29 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2016-09-15 07:24:29 +0000 |
commit | d2b72d3cc19fe2a7d548dac38d55e069e0c9a904 (patch) | |
tree | 9287ba936a5f8d80a61503d23bc5e4709645bb14 /src/edit.c | |
parent | core: New function gpgme_op_tofu_policy (diff) | |
download | gpgme-d2b72d3cc19fe2a7d548dac38d55e069e0c9a904.tar.gz gpgme-d2b72d3cc19fe2a7d548dac38d55e069e0c9a904.zip |
core: Minor change of the gpgme_op_edit semantics.
* src/edit.c (command_handler): Handle special error code.
* src/engine-gpg.c (read_status): Ditto.
* src/engine-gpgsm.c (status_handler): Ditto.
* src/engine-uiserver.c (status_handler): Ditto.
* src/util.h (GPG_ERR_FALSE): Define for older libgpg-error versions.
--
An edit callback may now simply return GPG_ERR_FALSE to indicate that
it did not handled the status code. GPGME will the do the appropriate
action, which is to send an empty line.
Note that it is highly unlikely that GPG_ERR_FALSE has ever been used
by an application as return value from an edit interactor.
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'src/edit.c')
-rw-r--r-- | src/edit.c | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -77,6 +77,8 @@ command_handler (void *priv, gpgme_status_code_t status, const char *args, if (err) return err; } + else + err = 0; if (!processed) { @@ -88,16 +90,15 @@ command_handler (void *priv, gpgme_status_code_t status, const char *args, if (err) return err; - /* FIXME: We expect the user to handle _all_ status codes. - Later, we may fix the callback interface to allow the user - indicate if it processed the status code or not. */ - *processed_r = 1; - - return (*opd->fnc) (opd->fnc_value, status, args, fd); + err = (*opd->fnc) (opd->fnc_value, status, args, fd); + if (gpg_err_code (err) == GPG_ERR_FALSE) + err = 0; + else + processed = 1; } *processed_r = processed; - return 0; + return err; } |