diff options
-rw-r--r-- | g10/ChangeLog | 8 | ||||
-rw-r--r-- | g10/delkey.c | 5 | ||||
-rw-r--r-- | g10/plaintext.c | 9 |
3 files changed, 15 insertions, 7 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog index eb0b0e34c..1ccd8f4aa 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,11 @@ +2004-02-25 David Shaw <[email protected]> + + * delkey.c (do_delete_key): Allow deleting a public key with a + secret present if --expert is set. + + * plaintext.c (handle_plaintext): Make bytecount static so it + works with multiple literal packets inside a message. + 2004-02-24 David Shaw <[email protected]> * encode.c (encode_simple): Show cipher with --verbose. diff --git a/g10/delkey.c b/g10/delkey.c index ca578a590..1041bcb0b 100644 --- a/g10/delkey.c +++ b/g10/delkey.c @@ -1,5 +1,6 @@ /* delkey.c - delete keys - * Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + * Copyright (C) 1998, 1999, 2000, 2001, 2002, + * 2004 Free Software Foundation, Inc. * * This file is part of GnuPG. * @@ -98,7 +99,7 @@ do_delete_key( const char *username, int secret, int *r_sec_avail ) pk = node->pkt->pkt.public_key; keyid_from_pk( pk, keyid ); rc = seckey_available( keyid ); - if( !rc ) { + if( !rc && !opt.expert ) { *r_sec_avail = 1; rc = -1; goto leave; diff --git a/g10/plaintext.c b/g10/plaintext.c index 0737fb02c..35ad3dbc1 100644 --- a/g10/plaintext.c +++ b/g10/plaintext.c @@ -41,7 +41,6 @@ #include "i18n.h" - /**************** * Handle a plaintext packet. If MFX is not NULL, update the MDs * Note: we should use the filter stuff here, but we have to add some @@ -54,7 +53,7 @@ handle_plaintext( PKT_plaintext *pt, md_filter_context_t *mfx, { char *fname = NULL; FILE *fp = NULL; - off_t count=0; + static off_t count=0; int rc = 0; int c; int convert = pt->mode == 't'; @@ -136,7 +135,7 @@ handle_plaintext( PKT_plaintext *pt, md_filter_context_t *mfx, #endif if( fp ) { - if(opt.max_output && (count++)>opt.max_output) + if(opt.max_output && (++count)>opt.max_output) { log_error("Error writing to `%s': %s\n", fname,"exceeded --max-output limit\n"); @@ -202,7 +201,7 @@ handle_plaintext( PKT_plaintext *pt, md_filter_context_t *mfx, #endif if( fp ) { - if(opt.max_output && (count++)>opt.max_output) + if(opt.max_output && (++count)>opt.max_output) { log_error("Error writing to `%s': %s\n", fname,"exceeded --max-output limit\n"); @@ -265,7 +264,7 @@ handle_plaintext( PKT_plaintext *pt, md_filter_context_t *mfx, while( (c = iobuf_get(pt->buf)) != -1 ) { if( fp ) { - if(opt.max_output && (count++)>opt.max_output) + if(opt.max_output && (++count)>opt.max_output) { log_error("Error writing to `%s': %s\n", fname,"exceeded --max-output limit\n"); |