aboutsummaryrefslogtreecommitdiffstats
path: root/g10/plaintext.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2003-04-15 15:46:13 +0000
committerWerner Koch <[email protected]>2003-04-15 15:46:13 +0000
commitb394776a80e2e192eeaf5de82b2df8660298a091 (patch)
tree93e71726d93f4ca7c1289ddb70f19c067b51519d /g10/plaintext.c
parent* gpg.sgml: Document --enable-progress-filter. (diff)
downloadgnupg-b394776a80e2e192eeaf5de82b2df8660298a091.tar.gz
gnupg-b394776a80e2e192eeaf5de82b2df8660298a091.zip
* Makefile.am (AM_CFLAGS): Make use of AM_CFLAGS and AM_LDFLAGS.
* g10.c, options.h: New option --enable-progress-filter. * progress.c (handle_progress): Make use of it.
Diffstat (limited to 'g10/plaintext.c')
-rw-r--r--g10/plaintext.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/g10/plaintext.c b/g10/plaintext.c
index a248598cd..89322670e 100644
--- a/g10/plaintext.c
+++ b/g10/plaintext.c
@@ -357,11 +357,16 @@ int
ask_for_detached_datafile( MD_HANDLE md, MD_HANDLE md2,
const char *inname, int textmode )
{
+ progress_filter_context_t pfx;
+ int dealloc_pfx_name = 1;
char *answer = NULL;
IOBUF fp;
int rc = 0;
- fp = open_sigfile( inname ); /* open default file */
+ fp = open_sigfile( inname, &pfx ); /* open default file */
+ if (!fp)
+ dealloc_pfx_name = 0;
+
if( !fp && !opt.batch ) {
int any=0;
tty_printf(_("Detached signature.\n"));
@@ -395,7 +400,8 @@ ask_for_detached_datafile( MD_HANDLE md, MD_HANDLE md2,
}
do_hash( md, md2, fp, textmode );
iobuf_close(fp);
-
+ if (dealloc_pfx_name)
+ m_free (pfx.what);
leave:
m_free(answer);
@@ -412,15 +418,17 @@ int
hash_datafiles( MD_HANDLE md, MD_HANDLE md2, STRLIST files,
const char *sigfilename, int textmode )
{
+ progress_filter_context_t pfx;
IOBUF fp;
STRLIST sl;
if( !files ) {
/* check whether we can open the signed material */
- fp = open_sigfile( sigfilename );
+ fp = open_sigfile( sigfilename, &pfx );
if( fp ) {
do_hash( md, md2, fp, textmode );
iobuf_close(fp);
+ m_free (pfx.what);
return 0;
}
log_error (_("no signed data\n"));
@@ -435,6 +443,7 @@ hash_datafiles( MD_HANDLE md, MD_HANDLE md2, STRLIST files,
print_fname_stdin(sl->d));
return G10ERR_OPEN_FILE;
}
+ handle_progress (&pfx, fp, sl->d);
do_hash( md, md2, fp, textmode );
iobuf_close(fp);
}