diff options
Diffstat (limited to 'gpgme/rungpg.c')
-rw-r--r-- | gpgme/rungpg.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/gpgme/rungpg.c b/gpgme/rungpg.c index 07231716..76313584 100644 --- a/gpgme/rungpg.c +++ b/gpgme/rungpg.c @@ -84,6 +84,7 @@ struct gpg_object_s { int eof; GpgColonLineHandler fnc; /* this indicate use of this structrue */ void *fnc_value; + int simple; } colon; char **argv; @@ -376,10 +377,25 @@ _gpgme_gpg_set_colon_line_handler ( GpgObject gpg, gpg->colon.eof = 0; gpg->colon.fnc = fnc; gpg->colon.fnc_value = fnc_value; + gpg->colon.simple = 0; return 0; } +GpgmeError +_gpgme_gpg_set_simple_line_handler ( GpgObject gpg, + GpgColonLineHandler fnc, + void *fnc_value ) +{ + GpgmeError err; + + err = _gpgme_gpg_set_colon_line_handler (gpg, fnc, fnc_value); + if (!err) + gpg->colon.simple = 1; + return err; +} + + /* * The Fnc will be called to get a value for one of the commands with * a key KEY. If the Code pssed to FNC is 0, the function may release @@ -1094,7 +1110,8 @@ read_colon_line ( GpgObject gpg ) * some other printed information. */ *p = 0; - if ( *buffer && strchr (buffer, ':') ) { + if ( gpg->colon.simple + || (*buffer && strchr (buffer, ':')) ) { assert (gpg->colon.fnc); gpg->colon.fnc ( gpg->colon.fnc_value, buffer ); } |