#include <time.h>
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 }
};
int debugsw = 0;
int verbosw = 0;
-int ebcdicsw = 0;
int listsw = 0;
int rfc934sw = 0;
int contentidsw = 1;
print_version(invo_name);
done(1);
- case EBCDICSW:
- ebcdicsw++;
- continue;
- case NEBCDICSW:
- ebcdicsw = 0;
- continue;
-
case HEADSW:
headsw++;
continue;
}
-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
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;
check8bit = 1;
checkboundary = 1;
if (ct->c_subtype == TEXT_PLAIN) {
- checkebcdic = 0;
checklinelen = 0;
checklinespace = 0;
} else {
- checkebcdic = ebcdicsw;
checklinelen = 1;
checklinespace = 1;
}
case CT_APPLICATION:
check8bit = 1;
- checkebcdic = ebcdicsw;
checklinelen = 1;
checklinespace = 1;
checkboundary = 1;
case CT_MESSAGE:
check8bit = 0;
- checkebcdic = 0;
checklinelen = 0;
checklinespace = 0;
checkboundary = 1;
** since we are forcing use of base64.
*/
check8bit = 0;
- checkebcdic = 0;
checklinelen = 0;
checklinespace = 0;
checkboundary = 0;
/* 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;
- }
}
}
*ep = cp;
}
- if (contains8bit || ebcdicunsafe || linelen || linespace)
+ if (contains8bit || linelen || linespace)
ct->c_encoding = CE_QUOTED;
else
ct->c_encoding = CE_7BIT;
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;
#include <h/mime.h>
#include <h/mhparse.h>
-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+/";
break;
default:
- if (*cp < '!' || *cp > '~' || (ebcdicsw && !ebcdicsafe[*cp & 0xff]))
+ if (*cp < '!' || *cp > '~')
goto three_print;
putc(*cp, out);
n++;