diff options
author | Werner Koch <wk@gnupg.org> | 1998-01-13 20:04:23 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 1998-01-13 20:04:23 +0100 |
commit | 922e57dd57ca46c5368c7044ca98b1ddf085828d (patch) | |
tree | caa0679030553da56e498bbac75d409bd3841a18 /g10/g10.c | |
parent | started with trust stuff (diff) | |
download | gnupg2-922e57dd57ca46c5368c7044ca98b1ddf085828d.tar.xz gnupg2-922e57dd57ca46c5368c7044ca98b1ddf085828d.zip |
*** empty log message ***
Diffstat (limited to 'g10/g10.c')
-rw-r--r-- | g10/g10.c | 29 |
1 files changed, 24 insertions, 5 deletions
@@ -424,17 +424,36 @@ main( int argc, char **argv ) break; case aSign: /* sign the given file */ - if( argc > 1 ) - usage(1); - if( (rc = sign_file(fname, detached_sig, locusr, 0, NULL)) ) - log_error("sign_file('%s'): %s\n", fname_print, g10_errstr(rc) ); + sl = NULL; + if( detached_sig ) { /* sign all files */ + for( ; argc; argc--, argv++ ) + add_to_strlist( &sl, *argv ); + } + else { + if( argc > 1 ) + usage(1); + if( argc ) { + sl = m_alloc_clear( sizeof *sl + strlen(fname)); + strcpy(sl->d, fname); + } + } + if( (rc = sign_file( sl, detached_sig, locusr, 0, NULL, NULL)) ) + log_error("sign_file: %s\n", g10_errstr(rc) ); + free_strlist(sl); break; case aSignEncr: /* sign and encrypt the given file */ if( argc > 1 ) usage(1); - if( (rc = sign_file(fname, detached_sig, locusr, 1, remusr)) ) + if( argc ) { + sl = m_alloc_clear( sizeof *sl + strlen(fname)); + strcpy(sl->d, fname); + } + else + sl = NULL; + if( (rc = sign_file(sl, detached_sig, locusr, 1, remusr, NULL)) ) log_error("sign_file('%s'): %s\n", fname_print, g10_errstr(rc) ); + free_strlist(sl); break; |