diff options
author | Werner Koch <wk@gnupg.org> | 1999-06-01 16:08:57 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 1999-06-01 16:08:57 +0200 |
commit | 3dddf602dd95863dab344486534874b4b561bd3d (patch) | |
tree | 322e4f944eb596a22af9fc4d98f2f000117672a7 /g10/plaintext.c | |
parent | See ChangeLog: Mon May 31 19:41:10 CEST 1999 Werner Koch (diff) | |
download | gnupg2-3dddf602dd95863dab344486534874b4b561bd3d.tar.xz gnupg2-3dddf602dd95863dab344486534874b4b561bd3d.zip |
See ChangeLog: Tue Jun 1 16:01:46 CEST 1999 Werner Koch
Diffstat (limited to 'g10/plaintext.c')
-rw-r--r-- | g10/plaintext.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/g10/plaintext.c b/g10/plaintext.c index 000ede0c3..1edca16e5 100644 --- a/g10/plaintext.c +++ b/g10/plaintext.c @@ -63,6 +63,13 @@ handle_plaintext( PKT_plaintext *pt, md_filter_context_t *mfx, log_info(_("data not saved; use option \"--output\" to save it\n")); nooutput = 1; } + else if( !opt.use_embedded_filename ) { + fname = make_outfile_name( iobuf_get_real_fname(pt->buf) ); + if( !fname ) { + rc = G10ERR_CREATE_FILE; + goto leave; + } + } else { fname = m_alloc( pt->namelen +1 ); memcpy( fname, pt->name, pt->namelen ); @@ -90,7 +97,7 @@ handle_plaintext( PKT_plaintext *pt, md_filter_context_t *mfx, if( pt->len ) { assert( !clearsig ); - if( convert ) { // text mode + if( convert ) { /* text mode */ for( ; pt->len; pt->len-- ) { if( (c = iobuf_get(pt->buf)) == -1 ) { log_error("Problem reading source (%u bytes remaining)\n", @@ -112,7 +119,7 @@ handle_plaintext( PKT_plaintext *pt, md_filter_context_t *mfx, } } } - else { // binary mode + else { /* binary mode */ byte *buffer = m_alloc( 32768 ); while( pt->len ) { int len = pt->len > 32768 ? 32768 : pt->len; @@ -141,7 +148,7 @@ handle_plaintext( PKT_plaintext *pt, md_filter_context_t *mfx, } } else if( !clearsig ) { - if( convert ) { // text mode + if( convert ) { /* text mode */ while( (c = iobuf_get(pt->buf)) != -1 ) { if( mfx->md ) md_putc(mfx->md, c ); @@ -157,7 +164,7 @@ handle_plaintext( PKT_plaintext *pt, md_filter_context_t *mfx, } } } - else { // binary mode + else { /* binary mode */ byte *buffer = m_alloc( 32768 ); for( ;; ) { int len = iobuf_read( pt->buf, buffer, 32768 ); |