[Pkg-gnupg-commit] [gpgme] 373/412: core: Map GPGME_STATUS_EOF to the empty string.
Daniel Kahn Gillmor
dkg at fifthhorseman.net
Thu Sep 22 21:27:22 UTC 2016
This is an automated email from the git hooks/post-receive script.
dkg pushed a commit to branch master
in repository gpgme.
commit 3d6340e8c59ee11a95e03fb213ad9b228be47833
Author: Werner Koch <wk at gnupg.org>
Date: Fri Sep 16 15:06:26 2016 +0200
core: Map GPGME_STATUS_EOF to the empty string.
* src/status-table.c (_gpgme_status_to_string): Return "" for EOF.
* src/engine-gpg.c (read_status): Ditto. The old code accidently used
GPGME_STATUS_EOF which is the integer 0 and neiteyr NULL nor a string.
Signed-off-by: Werner Koch <wk at gnupg.org>
---
doc/gpgme.texi | 13 +++++++------
src/engine-gpg.c | 3 +--
src/status-table.c | 2 +-
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/doc/gpgme.texi b/doc/gpgme.texi
index dc5a140..18fb6d5 100644
--- a/doc/gpgme.texi
+++ b/doc/gpgme.texi
@@ -4464,12 +4464,13 @@ could not be started.
@tindex gpgme_interact_cb_t
The @code{gpgme_interact_cb_t} type is the type of functions which
@acronym{GPGME} calls if it a key interact operation is on-going. The
-status keyword @var{status} and the argument line @var{args} are passed
-through by @acronym{GPGME} from the crypto engine. The file
-descriptor @var{fd} is -1 for normal status messages. If @var{status}
-indicates a command rather than a status message, the response to the
-command should be written to @var{fd}. The @var{handle} is provided
-by the user at start of operation.
+status keyword @var{status} and the argument line @var{args} are
+passed through by @acronym{GPGME} from the crypto engine. An empty
+string represents EOF. The file descriptor @var{fd} is -1 for normal
+status messages. If @var{status} indicates a command rather than a
+status message, the response to the command should be written to
+ at var{fd}. The @var{handle} is provided by the user at start of
+operation.
The function should return @code{GPG_ERR_FALSE} if it did not handle
the status code, @code{0} for success, or any other error value.
diff --git a/src/engine-gpg.c b/src/engine-gpg.c
index a7431d5..025657a 100644
--- a/src/engine-gpg.c
+++ b/src/engine-gpg.c
@@ -1095,8 +1095,7 @@ read_status (engine_gpg_t gpg)
err = 0;
gpg->status.eof = 1;
if (gpg->status.mon_cb)
- err = gpg->status.mon_cb (gpg->status.mon_cb_value,
- GPGME_STATUS_EOF, "");
+ err = gpg->status.mon_cb (gpg->status.mon_cb_value, "", "");
if (gpg->status.fnc)
{
char emptystring[1] = {0};
diff --git a/src/status-table.c b/src/status-table.c
index f44a08f..c9bf357 100644
--- a/src/status-table.c
+++ b/src/status-table.c
@@ -178,6 +178,6 @@ _gpgme_status_to_string (gpgme_status_code_t code)
for (i=0; i < DIM(status_table); i++)
if (status_table[i].code == code)
- return status_table[i].name;
+ return status_table[i].name? status_table[i].name : "";
return "status_code_lost";
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gpgme.git
More information about the Pkg-gnupg-commit
mailing list