From: Marcus Brinkmann Date: Tue, 27 May 2003 01:39:18 +0000 (+0000) Subject: Reintroduce a check in edit_fnc. X-Git-Tag: gpgme-1.2.0@1385~618 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f52a066e357281c21fdcabb0883f81398156ccd6;p=gpgme.git Reintroduce a check in edit_fnc. --- diff --git a/trunk/tests/gpg/t-edit.c b/trunk/tests/gpg/t-edit.c index d66933f..74f0cde 100644 --- a/trunk/tests/gpg/t-edit.c +++ b/trunk/tests/gpg/t-edit.c @@ -77,29 +77,32 @@ edit_fnc (void *opaque, gpgme_status_code_t status, const char *args, int fd) flush_data (out); fprintf (stdout, "[-- Code: %i, %s --]\n", status, args); - - if (!strcmp (args, "keyedit.prompt")) - { - static int step = 0; - switch (step) + if (fd >= 0) + { + if (!strcmp (args, "keyedit.prompt")) { - case 0: - result = "fpr"; - break; - case 1: - result = "expire"; - break; - default: - result = "quit"; - break; + static int step = 0; + + switch (step) + { + case 0: + result = "fpr"; + break; + case 1: + result = "expire"; + break; + default: + result = "quit"; + break; + } + step++; } - step++; + else if (!strcmp (args, "keyedit.save.okay")) + result = "Y"; + else if (!strcmp (args, "keygen.valid")) + result = "0"; } - else if (!strcmp (args, "keyedit.save.okay")) - result = "Y"; - else if (!strcmp (args, "keygen.valid")) - result = "0"; if (result) {