aboutsummaryrefslogtreecommitdiffstats
path: root/mimehead.c
diff options
context:
space:
mode:
authorTatsuya Kinoshita <tats@debian.org>2021-02-06 04:07:40 +0000
committerGitHub <noreply@github.com>2021-02-06 04:07:40 +0000
commite66ca9fa4ee8eb9e9370bba0bfa4d2084a300a3e (patch)
tree759d7d3bd2023845ab491d0f1810c8f278c6b150 /mimehead.c
parentUpdate ChangeLog (diff)
parentClarify inline image setting's wording (diff)
downloadw3m-e66ca9fa4ee8eb9e9370bba0bfa4d2084a300a3e.tar.gz
w3m-e66ca9fa4ee8eb9e9370bba0bfa4d2084a300a3e.zip
Merge pull request #161 from bptato/master
Improved inline image protocol support
Diffstat (limited to 'mimehead.c')
-rw-r--r--mimehead.c48
1 files changed, 0 insertions, 48 deletions
diff --git a/mimehead.c b/mimehead.c
index d16270c..2479137 100644
--- a/mimehead.c
+++ b/mimehead.c
@@ -350,51 +350,3 @@ decodeMIME0(Str orgstr)
return cnv;
}
-/* encoding */
-
-static char Base64Table[] =
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
-
-Str
-encodeB(char *a)
-{
- unsigned char d[3];
- unsigned char c1, c2, c3, c4;
- int i, n_pad;
- Str w = Strnew();
-
- while (1) {
- if (*a == '\0')
- break;
- n_pad = 0;
- d[1] = d[2] = 0;
- for (i = 0; i < 3; i++) {
- d[i] = a[i];
- if (a[i] == '\0') {
- n_pad = 3 - i;
- break;
- }
- }
- c1 = d[0] >> 2;
- c2 = (((d[0] << 4) | (d[1] >> 4)) & 0x3f);
- if (n_pad == 2) {
- c3 = c4 = 64;
- }
- else if (n_pad == 1) {
- c3 = ((d[1] << 2) & 0x3f);
- c4 = 64;
- }
- else {
- c3 = (((d[1] << 2) | (d[2] >> 6)) & 0x3f);
- c4 = (d[2] & 0x3f);
- }
- Strcat_char(w, Base64Table[c1]);
- Strcat_char(w, Base64Table[c2]);
- Strcat_char(w, Base64Table[c3]);
- Strcat_char(w, Base64Table[c4]);
- if (n_pad)
- break;
- a += 3;
- }
- return w;
-}