Ciao.
Well yes, i have messed up the jubilee version.
While waiting for test results of the OpenCSW cluster (external)
and the OpenBSD VM (locally), i have quickly added support for
64-bit IMAP UIDs, which are currently in the process of being
standardized. I should have listened to my evil subconsciousness,
but no, i have not.
As a result S-nail has a problem on 32-bit hosts, where "unsigned
long" is not of the same size as "ui64_t". The patch is simple
yet necessary, and has been pushed to all related branches.
I will attach it, too.
I hope the 50th jubilee will be just fine instead.
Ciao again, your unhappy
--steffen
|
|Der Kragenbaer, The moon bear,
|der holt sich munter he cheerfully and one by one
|einen nach dem anderen runter wa.ks himself off
|(By Robert Gernhardt)
FIX hasty [ab7aab0e] (Account for drafted 64-bit IMAP UIDs..)..
Unfortunately this has not adjusted all functions correctly,
which is a problem on 32-bit hosts where "unsigned long" is
not of equal size as ui64_t
---
obs-imap.c | 26 ++++++++++++--------------
1 file changed, 12 insertions(+), 14 deletions(-)
diff --git a/obs-imap.c b/obs-imap.c
index 95692bd2..d403078b 100644
--- a/obs-imap.c
+++ b/obs-imap.c
@@ -246,10 +246,9 @@ static enum okay imap_list(struct mailbox *mp, const char *base, int strip,
static enum okay imap_copy1(struct mailbox *mp, struct message *m, int n,
const char *name);
static enum okay imap_copyuid_parse(const char *cp,
- unsigned long *uidvalidity, unsigned long *olduid,
- unsigned long *newuid);
+ ui64_t *uidvalidity, ui64_t *olduid, ui64_t *newuid);
static enum okay imap_appenduid_parse(const char *cp,
- unsigned long *uidvalidity, unsigned long *uid);
+ ui64_t *uidvalidity, ui64_t *uid);
static enum okay imap_copyuid(struct mailbox *mp, struct message *m,
const char *name);
static enum okay imap_appenduid(struct mailbox *mp, FILE *fp, time_t t,
@@ -3465,16 +3464,16 @@ imap_copy(struct message *m, int n, const char *name)
}
static enum okay
-imap_copyuid_parse(const char *cp, unsigned long *uidvalidity,
- unsigned long *olduid, unsigned long *newuid)
+imap_copyuid_parse(const char *cp, ui64_t *uidvalidity, ui64_t *olduid,
+ ui64_t *newuid)
{
- char *xp, *yp, *zp;
+ char const *xp, *yp, *zp;
enum okay rv;
NYD_ENTER;
- *uidvalidity = strtoul(cp, &xp, 10);
- *olduid = strtoul(xp, &yp, 10);
- *newuid = strtoul(yp, &zp, 10);
+ n_idec_ui64_cp(uidvalidity, cp, 10, &xp); /* TODO errors */
+ n_idec_ui64_cp(olduid, xp, 10, &yp); /* TODO errors */
+ n_idec_ui64_cp(newuid, yp, 10, &zp); /* TODO errors */
rv = (*uidvalidity && *olduid && *newuid && xp > cp && *xp == ' ' &&
yp > xp && *yp == ' ' && zp > yp && *zp == ']');
NYD_LEAVE;
@@ -3482,15 +3481,14 @@ imap_copyuid_parse(const char *cp, unsigned long *uidvalidity,
}
static enum okay
-imap_appenduid_parse(const char *cp, unsigned long *uidvalidity,
- unsigned long *uid)
+imap_appenduid_parse(const char *cp, ui64_t *uidvalidity, ui64_t *uid)
{
- char *xp, *yp;
+ char const *xp, *yp;
enum okay rv;
NYD_ENTER;
- *uidvalidity = strtoul(cp, &xp, 10);
- *uid = strtoul(xp, &yp, 10);
+ n_idec_ui64_cp(uidvalidity, cp, 10, &xp); /* TODO errors */
+ n_idec_ui64_cp(uid, xp, 10, &yp); /* TODO errors */
rv = (*uidvalidity && *uid && xp > cp && *xp == ' ' && yp > xp &&
*yp == ']');
NYD_LEAVE;