2001-12-05 Marcus Brinkmann <marcus@g10code.de>
* engine-gpgsm.c (gpgsm_status_handler): Make it work with current version of assuan.
This commit is contained in:
parent
62d0374e72
commit
8cd3d96f2d
@ -1,3 +1,8 @@
|
|||||||
|
2001-12-05 Marcus Brinkmann <marcus@g10code.de>
|
||||||
|
|
||||||
|
* engine-gpgsm.c (gpgsm_status_handler): Make it work with current
|
||||||
|
version of assuan.
|
||||||
|
|
||||||
2001-12-05 Marcus Brinkmann <marcus@g10code.de>
|
2001-12-05 Marcus Brinkmann <marcus@g10code.de>
|
||||||
|
|
||||||
* engine-gpgsm.c (gpgsm_set_fd): Accept one more argument OPT.
|
* engine-gpgsm.c (gpgsm_set_fd): Accept one more argument OPT.
|
||||||
|
@ -476,25 +476,15 @@ gpgsm_status_handler (void *opaque, int pid, int fd)
|
|||||||
ASSUAN_CONTEXT actx = gpgsm->assuan_ctx;
|
ASSUAN_CONTEXT actx = gpgsm->assuan_ctx;
|
||||||
char *line;
|
char *line;
|
||||||
int linelen;
|
int linelen;
|
||||||
char *next_line;
|
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
assert (fd == gpgsm->assuan_ctx->inbound.fd);
|
assert (fd == gpgsm->assuan_ctx->inbound.fd);
|
||||||
|
|
||||||
err = _assuan_read_line (gpgsm->assuan_ctx);
|
err = _assuan_read_line (gpgsm->assuan_ctx);
|
||||||
|
|
||||||
/* Assuan can currently return more than one line at once. */
|
|
||||||
line = actx->inbound.line;
|
line = actx->inbound.line;
|
||||||
|
|
||||||
while (line)
|
|
||||||
{
|
|
||||||
next_line = strchr (line, '\n');
|
|
||||||
if (next_line)
|
|
||||||
*next_line++ = 0;
|
|
||||||
linelen = strlen (line);
|
linelen = strlen (line);
|
||||||
|
|
||||||
if (line[0] == '#' || !linelen)
|
|
||||||
return 0; /* FIXME */
|
|
||||||
|
|
||||||
if ((linelen >= 2
|
if ((linelen >= 2
|
||||||
&& line[0] == 'O' && line[1] == 'K'
|
&& line[0] == 'O' && line[1] == 'K'
|
||||||
&& (line[2] == '\0' || line[2] == ' '))
|
&& (line[2] == '\0' || line[2] == ' '))
|
||||||
@ -533,8 +523,8 @@ gpgsm_status_handler (void *opaque, int pid, int fd)
|
|||||||
else
|
else
|
||||||
fprintf (stderr, "[UNKNOWN STATUS]%s %s", t.name, rest);
|
fprintf (stderr, "[UNKNOWN STATUS]%s %s", t.name, rest);
|
||||||
}
|
}
|
||||||
line = next_line;
|
|
||||||
}
|
}
|
||||||
|
while (gpgsm->assuan_ctx->inbound.attic.linelen);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user