diff options
author | Werner Koch <[email protected]> | 1999-05-20 12:11:41 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 1999-05-20 12:11:41 +0000 |
commit | 77d6309e2189254cf7a45884fb7ef6a415761988 (patch) | |
tree | 60da5c2556a5b7cb9c8d65dedd7a293eec2a35e8 /g10/textfilter.c | |
parent | See ChangeLog: Wed May 19 16:04:30 CEST 1999 Werner Koch (diff) | |
download | gnupg-77d6309e2189254cf7a45884fb7ef6a415761988.tar.gz gnupg-77d6309e2189254cf7a45884fb7ef6a415761988.zip |
See ChangeLog: Thu May 20 14:04:08 CEST 1999 Werner Koch
Diffstat (limited to 'g10/textfilter.c')
-rw-r--r-- | g10/textfilter.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/g10/textfilter.c b/g10/textfilter.c index 5896c3f32..3125925b6 100644 --- a/g10/textfilter.c +++ b/g10/textfilter.c @@ -37,14 +37,14 @@ /* to make sure that a warning is displayed while */ /* creating a message */ -unsigned -len_without_trailing_ws( byte *line, unsigned len ) +static unsigned +len_without_trailing_chars( byte *line, unsigned len, const char *trimchars ) { byte *p, *mark; unsigned n; for(mark=NULL, p=line, n=0; n < len; n++, p++ ) { - if( strchr(" \t\r\n", *p ) ) { + if( strchr( trimchars, *p ) ) { if( !mark ) mark = p; } @@ -55,6 +55,12 @@ len_without_trailing_ws( byte *line, unsigned len ) return mark? (mark - line) : len; } +unsigned +len_without_trailing_ws( byte *line, unsigned len ) +{ + return len_without_trailing_chars( line, len, " \t\r\n" ); +} + @@ -136,7 +142,7 @@ text_filter( void *opaque, int control, */ int copy_clearsig_text( IOBUF out, IOBUF inp, MD_HANDLE md, - int escape_dash, int escape_from ) + int escape_dash, int escape_from, int pgp2mode ) { unsigned maxlen; byte *buffer = NULL; /* malloced buffer */ @@ -163,7 +169,9 @@ copy_clearsig_text( IOBUF out, IOBUF inp, MD_HANDLE md, md_putc( md, '\r' ); md_putc( md, '\n' ); } - md_write( md, buffer, len_without_trailing_ws( buffer, n ) ); + md_write( md, buffer, + len_without_trailing_chars( buffer, n, + pgp2mode? " \r\n":" \t\r\n")); } else md_write( md, buffer, n ); |