summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2020-11-23 02:05:23 -0700
committerEduardo Chappa <chappa@washington.edu>2020-11-23 02:05:23 -0700
commitf325ca65eac61db3cbcebe31626fb3a76e60ec69 (patch)
tree52ebb9543549ef54a2ccce4b03c54f7bcb595d01
parentfc5a3d34bb2dd42de653e2a2ad761d229aba8954 (diff)
downloadalpine-f325ca65eac61db3cbcebe31626fb3a76e60ec69.tar.xz
* Add support for the base64 URL encoding.
-rw-r--r--imap/src/c-client/rfc822.c13
-rw-r--r--imap/src/c-client/rfc822.h1
-rw-r--r--pith/pine.hlp2
3 files changed, 15 insertions, 1 deletions
diff --git a/imap/src/c-client/rfc822.c b/imap/src/c-client/rfc822.c
index 214ba14..9a26af7 100644
--- a/imap/src/c-client/rfc822.c
+++ b/imap/src/c-client/rfc822.c
@@ -2093,6 +2093,19 @@ unsigned char *rfc822_binary (void *src,unsigned long srcl,unsigned long *len)
if (((unsigned long) (d - ret)) != *len) fatal ("rfc822_binary logic flaw");
return ret; /* return the resulting string */
}
+unsigned char *rfc822_urlbinary (void *src,unsigned long srcl,unsigned long *len)
+{
+ unsigned char *s, *ret = rfc822_binary (src, srcl, len);
+
+ for(s = ret; s && *s; s++)
+ switch(*s){
+ case '+': *s = '-'; break;
+ case '/': *s = '_'; break;
+ case '=': *s = '\0'; *len = s - ret; *++s = '\0'; break;
+ default : break;
+ }
+ return ret;
+}
/* Convert QUOTED-PRINTABLE contents to 8BIT
* Accepts: source
diff --git a/imap/src/c-client/rfc822.h b/imap/src/c-client/rfc822.h
index 0621732..f8f605b 100644
--- a/imap/src/c-client/rfc822.h
+++ b/imap/src/c-client/rfc822.h
@@ -101,6 +101,7 @@ void rfc822_encode_body_8bit (ENVELOPE *env,BODY *body);
long rfc822_output_text (RFC822BUFFER *buf,BODY *body);
void *rfc822_base64 (unsigned char *src,unsigned long srcl,unsigned long *len);
unsigned char *rfc822_binary (void *src,unsigned long srcl,unsigned long *len);
+unsigned char *rfc822_urlbinary (void *src,unsigned long srcl,unsigned long *len);
unsigned char *rfc822_qprint (unsigned char *src,unsigned long srcl,
unsigned long *len);
unsigned char *rfc822_8bit (unsigned char *src,unsigned long srcl,
diff --git a/pith/pine.hlp b/pith/pine.hlp
index 1f6f651..d1c57b8 100644
--- a/pith/pine.hlp
+++ b/pith/pine.hlp
@@ -140,7 +140,7 @@ with help text for the config screen and the composer that didn't have any
reasonable place to be called from.
Dummy change to get revision in pine.hlp
============= h_revision =================
-Alpine Commit 515 2020-11-01 16:21:21
+Alpine Commit 516 2020-11-23 02:05:20
============= h_news =================
<HTML>
<HEAD>