aboutsummaryrefslogtreecommitdiffstats
path: root/g10/plaintext.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>1999-01-09 15:06:59 +0000
committerWerner Koch <[email protected]>1999-01-09 15:06:59 +0000
commit002b1a8632d2c2795deb4682ba6db8be120db9b4 (patch)
tree33a0e8c96550f24d9aa1747b05a9f471f975e7a7 /g10/plaintext.c
parentSee ChangeLog: Thu Jan 7 18:00:58 CET 1999 Werner Koch (diff)
downloadgnupg-002b1a8632d2c2795deb4682ba6db8be120db9b4.tar.gz
gnupg-002b1a8632d2c2795deb4682ba6db8be120db9b4.zip
See ChangeLog: Sat Jan 9 16:02:23 CET 1999 Werner Koch
Diffstat (limited to 'g10/plaintext.c')
-rw-r--r--g10/plaintext.c61
1 files changed, 5 insertions, 56 deletions
diff --git a/g10/plaintext.c b/g10/plaintext.c
index c5c6685f4..887b583f6 100644
--- a/g10/plaintext.c
+++ b/g10/plaintext.c
@@ -1,5 +1,5 @@
/* plaintext.c - process an plaintext packet
- * Copyright (C) 1998 Free Software Foundation, Inc.
+ * Copyright (C) 1998, 1999 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
@@ -35,46 +35,6 @@
#include "i18n.h"
-/****************
- * Defer the last CR,LF
- */
-static void
-special_md_putc( MD_HANDLE md, int c, int *state )
-{
- if( c == -1 ) { /* flush */
- if( *state == 1 ) {
- md_putc(md, '\r');
- }
-
- *state = 0;
- return;
- }
- again:
- switch( *state ) {
- case 0:
- if( c == '\r' )
- *state = 1;
- else
- md_putc(md, c );
- break;
- case 1:
- if( c == '\n' )
- *state = 2;
- else {
- md_putc(md, '\r');
- *state = 0;
- goto again;
- }
- break;
- case 2:
- md_putc(md, '\r');
- md_putc(md, '\n');
- *state = 0;
- goto again;
- default: BUG();
- }
-}
-
/****************
* Handle a plaintext packet. If MFX is not NULL, update the MDs
@@ -91,7 +51,6 @@ handle_plaintext( PKT_plaintext *pt, md_filter_context_t *mfx,
int rc = 0;
int c;
int convert = pt->mode == 't';
- int special_state = 0;
/* create the filename as C string */
if( nooutput )
@@ -137,12 +96,8 @@ handle_plaintext( PKT_plaintext *pt, md_filter_context_t *mfx,
rc = G10ERR_READ_FILE;
goto leave;
}
- if( mfx->md ) {
- if( 0 && convert && clearsig )
- special_md_putc(mfx->md, c, &special_state );
- else
- md_putc(mfx->md, c );
- }
+ if( mfx->md )
+ md_putc(mfx->md, c );
if( convert && !clearsig && c == '\r' )
continue; /* fixme: this hack might be too simple */
if( fp ) {
@@ -157,12 +112,8 @@ handle_plaintext( PKT_plaintext *pt, md_filter_context_t *mfx,
}
else {
while( (c = iobuf_get(pt->buf)) != -1 ) {
- if( mfx->md ) {
- if( 0 && convert && clearsig )
- special_md_putc(mfx->md, c, &special_state );
- else
- md_putc(mfx->md, c );
- }
+ if( mfx->md )
+ md_putc(mfx->md, c );
if( convert && !clearsig && c == '\r' )
continue; /* fixme: this hack might be too simple */
if( fp ) {
@@ -176,8 +127,6 @@ handle_plaintext( PKT_plaintext *pt, md_filter_context_t *mfx,
}
pt->buf = NULL;
}
- if( 0 && mfx->md && convert && clearsig )
- special_md_putc(mfx->md, -1, &special_state ); /* flush */
if( fp && fp != stdout && fclose(fp) ) {
log_error("Error closing `%s': %s\n", fname, strerror(errno) );