git://git.exim.org
/
exim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Revert "GnuTLS: remove GNUTLS_E_AGAIN handling"
[exim.git]
/
src
/
src
/
imap_utf7.c
diff --git
a/src/src/imap_utf7.c
b/src/src/imap_utf7.c
index 739e47f41f246e8a5072adac454dcf0fd1d4fb85..aac0fef6a04e1fffe84e6ff6620a2b46ef867819 100644
(file)
--- a/
src/src/imap_utf7.c
+++ b/
src/src/imap_utf7.c
@@
-1,6
+1,9
@@
+/* Copyright (c) University of Cambridge 1995 - 2018 */
+/* See the file NOTICE for conditions of use and distribution. */
+
#include "exim.h"
#include "exim.h"
-#ifdef
EXPERIMENTAL_INTERNATIONAL
+#ifdef
SUPPORT_I18N
uschar *
imap_utf7_encode(uschar *string, const uschar *charset, uschar sep,
uschar *
imap_utf7_encode(uschar *string, const uschar *charset, uschar sep,
@@
-8,11
+11,10
@@
imap_utf7_encode(uschar *string, const uschar *charset, uschar sep,
{
static uschar encode_base64[64] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+,";
{
static uschar encode_base64[64] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+,";
-int ptr = 0;
-int size = 0;
size_t slen;
size_t slen;
-uschar *sptr, *yield = NULL;
-int i = 0, j; /* compiler quietening */
+uschar *sptr;
+gstring * yield = NULL;
+int i = 0; /* compiler quietening */
uschar c = 0; /* compiler quietening */
BOOL base64mode = FALSE;
BOOL lastsep = FALSE;
uschar c = 0; /* compiler quietening */
BOOL base64mode = FALSE;
BOOL lastsep = FALSE;
@@
-104,7
+106,7
@@
while (slen > 0)
i = 0;
}
i = 0;
}
- for (j = 0; j < 2; j++, s++) switch (i++)
+ for (
int
j = 0; j < 2; j++, s++) switch (i++)
{
case 0:
/* Top 6 bits of the first octet */
{
case 0:
/* Top 6 bits of the first octet */
@@
-165,13
+167,12
@@
while (slen > 0)
else
{
*error = string_sprintf("imapfolder: illegal character '%c'", s[1]);
else
{
*error = string_sprintf("imapfolder: illegal character '%c'", s[1]);
- if (yield) store_reset(yield);
return NULL;
}
if (outptr > outbuf + sizeof(outbuf) - 3)
{
return NULL;
}
if (outptr > outbuf + sizeof(outbuf) - 3)
{
- yield = string_cat
(yield, &size, &ptr
, outbuf, outptr - outbuf);
+ yield = string_cat
n(yield
, outbuf, outptr - outbuf);
outptr = outbuf;
}
outptr = outbuf;
}
@@
-197,12
+198,12
@@
if (base64mode)
iconv_close(icd);
#endif
iconv_close(icd);
#endif
-yield = string_cat
(yield, &size, &ptr
, outbuf, outptr - outbuf);
-if (yield[ptr-1] == '.')
- ptr--;
-
yield[ptr] = '\0'
;
+yield = string_cat
n(yield
, outbuf, outptr - outbuf);
+
+if (yield->s[yield->ptr-1] == '.')
+
yield->ptr--
;
-return
yield
;
+return
string_from_gstring(yield)
;
}
#endif /* whole file */
}
#endif /* whole file */