summaryrefslogtreecommitdiffstats
path: root/g10/g10.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>1998-01-13 20:04:23 +0100
committerWerner Koch <wk@gnupg.org>1998-01-13 20:04:23 +0100
commit922e57dd57ca46c5368c7044ca98b1ddf085828d (patch)
treecaa0679030553da56e498bbac75d409bd3841a18 /g10/g10.c
parentstarted with trust stuff (diff)
downloadgnupg2-922e57dd57ca46c5368c7044ca98b1ddf085828d.tar.xz
gnupg2-922e57dd57ca46c5368c7044ca98b1ddf085828d.zip
*** empty log message ***
Diffstat (limited to 'g10/g10.c')
-rw-r--r--g10/g10.c29
1 files changed, 24 insertions, 5 deletions
diff --git a/g10/g10.c b/g10/g10.c
index e5c7139d1..2002e69e1 100644
--- a/g10/g10.c
+++ b/g10/g10.c
@@ -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;