aboutsummaryrefslogtreecommitdiffstats
path: root/g10/plaintext.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2016-07-13 13:11:46 +0000
committerWerner Koch <[email protected]>2016-07-13 13:11:46 +0000
commit4ef62278e3c9406360dc50288f422291497e218f (patch)
treefff3a49be5c2659ab87195e5b0a4f88e51a49205 /g10/plaintext.c
parentMerge branch 'master' into STABLE-BRANCH-2-2 (diff)
parentgpg: New option --mimemode. (diff)
downloadgnupg-4ef62278e3c9406360dc50288f422291497e218f.tar.gz
gnupg-4ef62278e3c9406360dc50288f422291497e218f.zip
Merge branch 'master' into STABLE-BRANCH-2-2
--
Diffstat (limited to 'g10/plaintext.c')
-rw-r--r--g10/plaintext.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/g10/plaintext.c b/g10/plaintext.c
index e118f6b4d..c9fb67cdc 100644
--- a/g10/plaintext.c
+++ b/g10/plaintext.c
@@ -217,11 +217,16 @@ handle_plaintext (PKT_plaintext * pt, md_filter_context_t * mfx,
static off_t count = 0;
int err = 0;
int c;
- int convert = (pt->mode == 't' || pt->mode == 'u');
+ int convert;
#ifdef __riscos__
int filetype = 0xfff;
#endif
+ if (pt->mode == 't' || pt->mode == 'u' || pt->mode == 'm')
+ convert = pt->mode;
+ else
+ convert = 0;
+
/* Let people know what the plaintext info is. This allows the
receiving program to try and do something different based on the
format code (say, recode UTF-8 to local). */
@@ -279,8 +284,10 @@ handle_plaintext (PKT_plaintext * pt, md_filter_context_t * mfx,
if (mfx->md)
gcry_md_putc (mfx->md, c);
#ifndef HAVE_DOSISH_SYSTEM
- if (c == '\r') /* convert to native line ending */
- continue; /* fixme: this hack might be too simple */
+ /* Convert to native line ending. */
+ /* fixme: this hack might be too simple */
+ if (c == '\r' && convert != 'm')
+ continue;
#endif
if (fp)
{
@@ -354,7 +361,7 @@ handle_plaintext (PKT_plaintext * pt, md_filter_context_t * mfx,
if (mfx->md)
gcry_md_putc (mfx->md, c);
#ifndef HAVE_DOSISH_SYSTEM
- if (convert && c == '\r')
+ if (c == '\r' && convert != 'm')
continue; /* fixme: this hack might be too simple */
#endif
if (fp)