From 01a3480928da485b4d6109d36d751dfa71799d58 Mon Sep 17 00:00:00 2001 From: markus schnalke Date: Tue, 1 May 2012 11:37:53 +0200 Subject: [PATCH] mhbuild: Removed the -ebcdicsafe switch. It only influenced MIME messages, where quoted-printable encoding encoded some punctuation chars (e.g. $) as well. I guess this is not much of a problem anymore today. The switch was deactivated by default and didn't even appear in the 1991's version of Jerry Peek's MH book. In the 1999's version there is a parenthesed note about the switch, not more. I guess we won't miss it. --- man/mhbuild.man1 | 13 -------- uip/mhbuild.c | 94 +++++++++--------------------------------------------- uip/mhoutsbr.c | 38 +--------------------- uip/mhtest.c | 2 -- 4 files changed, 16 insertions(+), 131 deletions(-) diff --git a/man/mhbuild.man1 b/man/mhbuild.man1 index 2c4bcce..b7c12e6 100644 --- a/man/mhbuild.man1 +++ b/man/mhbuild.man1 @@ -11,7 +11,6 @@ mhbuild \- translate MIME composition draft .I file .RB [ \-list " | " \-nolist ] .RB [ \-headers " | " \-noheaders ] -.RB [ \-ebcdicsafe " | " \-noebcdicsafe ] .RB [ \-rfc934mode " | " \-norfc934mode ] .RB [ \-contentid " | " \-nocontentid ] .RB [ \-verbose " | " \-noverbose ] @@ -397,17 +396,6 @@ including files, etc., it scans the contents of the message to determine which transfer encoding to use. It will check for 8bit data, long lines, spaces at the end of lines, and clashes with multipart boundaries. It will then choose a transfer encoding appropriate for each content type. -.PP -The switch -.B \-ebcdicsafe -will cause -.B mhbuild -to slightly change -the way in which it performs the \*(lqquoted-printable\*(rq transfer -encoding. Along with encoding 8\-bit characters, it will now also encode -certain common punctuation characters as well. This slightly reduces the -readability of the message, but allows the message to pass more reliably -through mail gateways which involve the EBCDIC character encoding. .SS "Invoking mhbuild" Typically, @@ -554,7 +542,6 @@ mhlist(1), show(1), mhstore(1), .RB ` \-headers ' .RB ` \-norfc934mode ' .RB ` \-contentid ' -.RB ` \-noebcdicsafe ' .RB ` \-noverbose ' .fi diff --git a/uip/mhbuild.c b/uip/mhbuild.c index cc319f5..5cccd2a 100644 --- a/uip/mhbuild.c +++ b/uip/mhbuild.c @@ -29,35 +29,31 @@ #include static struct swit switches[] = { -#define EBCDICSW 0 - { "ebcdicsafe", 0 }, -#define NEBCDICSW 1 - { "noebcdicsafe", 0 }, -#define HEADSW 2 +#define HEADSW 0 { "headers", 0 }, -#define NHEADSW 3 +#define NHEADSW 1 { "noheaders", 0 }, -#define LISTSW 4 +#define LISTSW 2 { "list", 0 }, -#define NLISTSW 5 +#define NLISTSW 3 { "nolist", 0 }, -#define RFC934SW 6 +#define RFC934SW 4 { "rfc934mode", 0 }, -#define NRFC934SW 7 +#define NRFC934SW 5 { "norfc934mode", 0 }, -#define VERBSW 8 +#define VERBSW 6 { "verbose", 0 }, -#define NVERBSW 9 +#define NVERBSW 7 { "noverbose", 0 }, -#define CONTENTIDSW 10 +#define CONTENTIDSW 8 { "contentid", 0 }, -#define NCONTENTIDSW 11 +#define NCONTENTIDSW 9 { "nocontentid", 0 }, -#define VERSIONSW 12 +#define VERSIONSW 10 { "version", 0 }, -#define HELPSW 13 +#define HELPSW 11 { "help", 0 }, -#define DEBUGSW 14 +#define DEBUGSW 12 { "debug", -5 }, { NULL, 0 } }; @@ -103,7 +99,6 @@ static CT build_mime(char *); int debugsw = 0; int verbosw = 0; -int ebcdicsw = 0; int listsw = 0; int rfc934sw = 0; int contentidsw = 1; @@ -183,13 +178,6 @@ main(int argc, char **argv) print_version(invo_name); done(1); - case EBCDICSW: - ebcdicsw++; - continue; - case NEBCDICSW: - ebcdicsw = 0; - continue; - case HEADSW: headsw++; continue; @@ -1130,42 +1118,6 @@ set_id(CT ct, int top) } -static char ebcdicsafe[0x100] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, - 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; - - /* ** Fill out, or expand the various contents in the composition ** draft. Read-in any necessary files. Parse and execute any @@ -1412,7 +1364,6 @@ scan_content(CT ct) int checklinelen = 0, linelen = 0; /* check for long lines */ int checkboundary = 0, boundaryclash = 0; /* check if clashes with multipart boundary */ int checklinespace = 0, linespace = 0; /* check if any line ends with space */ - int checkebcdic = 0, ebcdicunsafe = 0; /* check if contains ebcdic unsafe characters */ unsigned char *cp = NULL, buffer[BUFSIZ]; struct text *t = NULL; FILE *in = NULL; @@ -1459,11 +1410,9 @@ scan_content(CT ct) check8bit = 1; checkboundary = 1; if (ct->c_subtype == TEXT_PLAIN) { - checkebcdic = 0; checklinelen = 0; checklinespace = 0; } else { - checkebcdic = ebcdicsw; checklinelen = 1; checklinespace = 1; } @@ -1471,7 +1420,6 @@ scan_content(CT ct) case CT_APPLICATION: check8bit = 1; - checkebcdic = ebcdicsw; checklinelen = 1; checklinespace = 1; checkboundary = 1; @@ -1479,7 +1427,6 @@ scan_content(CT ct) case CT_MESSAGE: check8bit = 0; - checkebcdic = 0; checklinelen = 0; checklinespace = 0; checkboundary = 1; @@ -1493,7 +1440,6 @@ scan_content(CT ct) ** since we are forcing use of base64. */ check8bit = 0; - checkebcdic = 0; checklinelen = 0; checklinespace = 0; checkboundary = 0; @@ -1519,16 +1465,6 @@ scan_content(CT ct) /* no need to keep checking */ check8bit = 0; } - /* - ** Check if character is ebcdic-safe. - ** We only check this if also checking - ** for 8bit data. - */ - if (checkebcdic && !ebcdicsafe[*cp & 0xff]) { - ebcdicunsafe = 1; - /* no need to keep checking */ - checkebcdic = 0; - } } } @@ -1605,7 +1541,7 @@ scan_content(CT ct) *ep = cp; } - if (contains8bit || ebcdicunsafe || linelen || linespace) + if (contains8bit || linelen || linespace) ct->c_encoding = CE_QUOTED; else ct->c_encoding = CE_7BIT; @@ -1613,7 +1549,7 @@ scan_content(CT ct) case CT_APPLICATION: /* For application type, use base64, except when postscript */ - if (contains8bit || ebcdicunsafe || linelen || linespace) + if (contains8bit || linelen || linespace) ct->c_encoding = (ct->c_subtype == APPLICATION_POSTSCRIPT) ? CE_QUOTED : CE_BASE64; diff --git a/uip/mhoutsbr.c b/uip/mhoutsbr.c index 5d267ef..d517e6e 100644 --- a/uip/mhoutsbr.c +++ b/uip/mhoutsbr.c @@ -16,42 +16,6 @@ #include #include -extern int ebcdicsw; - -static char ebcdicsafe[0x100] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, - 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; static char nib2b64[0x40+1] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; @@ -282,7 +246,7 @@ writeQuoted(CT ct, FILE *out) break; default: - if (*cp < '!' || *cp > '~' || (ebcdicsw && !ebcdicsafe[*cp & 0xff])) + if (*cp < '!' || *cp > '~') goto three_print; putc(*cp, out); n++; diff --git a/uip/mhtest.c b/uip/mhtest.c index a19475b..33b8026 100644 --- a/uip/mhtest.c +++ b/uip/mhtest.c @@ -39,8 +39,6 @@ static struct swit switches[] = { }; -int ebcdicsw = 0; /* hack for linking purposes */ - /* mhparse.c */ extern char *tmp; /* directory to place temp files */ -- 1.7.10.4