From 2d3958be5c2ac7538c3879900d87b7a0e830cb6f Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Wed, 5 Dec 2001 20:38:50 +0000 Subject: [PATCH] 2001-12-05 Marcus Brinkmann * engine-gpgsm.c (gpgsm_status_handler): Make it work with current version of assuan. --- trunk/gpgme/ChangeLog | 5 +++++ trunk/gpgme/engine-gpgsm.c | 24 +++++++----------------- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/trunk/gpgme/ChangeLog b/trunk/gpgme/ChangeLog index a5bd6ae..2f6b2f2 100644 --- a/trunk/gpgme/ChangeLog +++ b/trunk/gpgme/ChangeLog @@ -1,3 +1,8 @@ +2001-12-05 Marcus Brinkmann + + * engine-gpgsm.c (gpgsm_status_handler): Make it work with current + version of assuan. + 2001-12-05 Marcus Brinkmann * engine-gpgsm.c (gpgsm_set_fd): Accept one more argument OPT. diff --git a/trunk/gpgme/engine-gpgsm.c b/trunk/gpgme/engine-gpgsm.c index 7cc68b1..04f32a0 100644 --- a/trunk/gpgme/engine-gpgsm.c +++ b/trunk/gpgme/engine-gpgsm.c @@ -476,24 +476,14 @@ gpgsm_status_handler (void *opaque, int pid, int fd) ASSUAN_CONTEXT actx = gpgsm->assuan_ctx; char *line; int linelen; - char *next_line; - assert (fd == gpgsm->assuan_ctx->inbound.fd); - - err = _assuan_read_line (gpgsm->assuan_ctx); - - /* Assuan can currently return more than one line at once. */ - line = actx->inbound.line; - - while (line) + do { - next_line = strchr (line, '\n'); - if (next_line) - *next_line++ = 0; - linelen = strlen (line); + assert (fd == gpgsm->assuan_ctx->inbound.fd); - if (line[0] == '#' || !linelen) - return 0; /* FIXME */ + err = _assuan_read_line (gpgsm->assuan_ctx); + line = actx->inbound.line; + linelen = strlen (line); if ((linelen >= 2 && line[0] == 'O' && line[1] == 'K' @@ -533,9 +523,9 @@ gpgsm_status_handler (void *opaque, int pid, int fd) else fprintf (stderr, "[UNKNOWN STATUS]%s %s", t.name, rest); } - line = next_line; } - + while (gpgsm->assuan_ctx->inbound.attic.linelen); + return 0; } -- 2.26.2