Module Name:    src
Committed By:   christos
Date:           Fri Jan  4 01:43:59 UTC 2013

Modified Files:
        src/usr.bin/mail: mime_attach.c

Log Message:
PR/47395: Steffen: mail(1) unnecessarily uses base64 if a CR without a LF is 
seen


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/mail/mime_attach.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/mail/mime_attach.c
diff -u src/usr.bin/mail/mime_attach.c:1.14 src/usr.bin/mail/mime_attach.c:1.15
--- src/usr.bin/mail/mime_attach.c:1.14	Sun Apr 29 19:50:22 2012
+++ src/usr.bin/mail/mime_attach.c	Thu Jan  3 20:43:59 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: mime_attach.c,v 1.14 2012/04/29 23:50:22 christos Exp $	*/
+/*	$NetBSD: mime_attach.c,v 1.15 2013/01/04 01:43:59 christos Exp $	*/
 
 /*-
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 
 #include <sys/cdefs.h>
 #ifndef __lint__
-__RCSID("$NetBSD: mime_attach.c,v 1.14 2012/04/29 23:50:22 christos Exp $");
+__RCSID("$NetBSD: mime_attach.c,v 1.15 2013/01/04 01:43:59 christos Exp $");
 #endif /* not __lint__ */
 
 #include <assert.h>
@@ -236,7 +236,7 @@ content_encoding_core(void *fh, const ch
 	while ((c = fgetc(fh)) != EOF) {
 		curlen++;
 
-		if (c == '\0' || (lastc == '\r' && c != '\n'))
+		if (c == '\0')
 			return MIME_TRANSFER_BASE64;
 
 		if (c > 0x7f) {
@@ -252,7 +252,7 @@ content_encoding_core(void *fh, const ch
 				maxlen = curlen;
 			curlen = 0;
 		}
-		else if ((c < 0x20 && c != '\t') || c == 0x7f)
+		else if ((c < 0x20 && c != '\t') || c == 0x7f || lastc == '\r')
 			ctrlchar = 1;
 
 		lastc = c;

Reply via email to