diff options
Diffstat (limited to 'g10/plaintext.c')
-rw-r--r-- | g10/plaintext.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/g10/plaintext.c b/g10/plaintext.c index 29324d90d..4a5c3fb98 100644 --- a/g10/plaintext.c +++ b/g10/plaintext.c @@ -538,13 +538,20 @@ hash_datafiles( MD_HANDLE md, MD_HANDLE md2, STRLIST files, STRLIST sl; if( !files ) { - /* check whether we can open the signed material */ - fp = open_sigfile( sigfilename, &pfx ); - if( fp ) { - do_hash( md, md2, fp, textmode ); - iobuf_close(fp); - return 0; - } + /* Check whether we can open the signed material. We avoid + trying to open a file if run in batch mode. This assumed + data file for a sig file feature is just a convenience thing + for the command line and the user needs to read possible + warning messages. */ + if (!opt.batch) { + fp = open_sigfile( sigfilename, &pfx ); + if( fp ) { + do_hash( md, md2, fp, textmode ); + iobuf_close(fp); + return 0; + } + } + log_error (_("no signed data\n")); return G10ERR_OPEN_FILE; } |