diff options
Diffstat (limited to 'g10/sign.c')
-rw-r--r-- | g10/sign.c | 100 |
1 files changed, 0 insertions, 100 deletions
diff --git a/g10/sign.c b/g10/sign.c index dd7f50c35..4d4288449 100644 --- a/g10/sign.c +++ b/g10/sign.c @@ -455,106 +455,6 @@ sign_file( STRLIST filenames, int detached, STRLIST locusr, } -#if 0 -/**************** - * Note: We do not calculate the hash over the last CR,LF - */ -static int -write_dash_escaped( IOBUF inp, IOBUF out, MD_HANDLE md ) -{ - int c; - int lastlf = 1; - int state = 0; - - if( opt.not_dash_escaped ) { - lastlf = 0; - while( (c = iobuf_get(inp)) != -1 ) { - md_putc(md, c ); - iobuf_put( out, c ); - lastlf = c; - } - if( lastlf != '\n' ) { - /* add a missing trailing LF */ - md_putc(md, '\n' ); - iobuf_put( out, '\n' ); - } - - return 0; - } - - while( (c = iobuf_get(inp)) != -1 ) { - if( lastlf ) { - if( c == '-' ) { - iobuf_put( out, c ); - iobuf_put( out, ' ' ); - } - else if( c == 'F' && opt.escape_from ) { - int i; - - if( state >= 1 ) - md_putc(md, '\r'); - if( state >= 2 ) - md_putc(md, '\n'); - state = 0; - - for( i=1; i < 5 && (c = iobuf_get(inp)) != -1; i++ ) { - if( "From "[i] != c ) - break; - } - if( i < 5 ) { - iobuf_write( out, "From", i ); - md_write( md, "From", i ); - if( c == -1 ) - break; - } - else { - iobuf_writestr( out, "- From" ); - md_write( md, "From", 4 ); - } - } - } - - 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(); - } - iobuf_put( out, c ); - lastlf = c == '\n'; - } - if( state == 1 ) - md_putc(md, '\r'); - else if( state == 2 ) { /* file ended with a new line */ - md_putc(md, '\r'); - md_putc(md, '\n'); - iobuf_put( out, '\n'); - } - - if( !lastlf ) - iobuf_put( out, '\n' ); - - return 0; /* fixme: add error handling */ -} -#endif /**************** * make a clear signature. note that opt.armor is not needed |