From 1b9f8b4c69e87143b3d129734331c1411cc83bf4 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 31 Jul 2006 05:30:46 +0000 Subject: [PATCH] glibc seems to be *really* fucked up. --- src/drv_maildir.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/drv_maildir.c b/src/drv_maildir.c index 7a44b70..d3f83d4 100644 --- a/src/drv_maildir.c +++ b/src/drv_maildir.c @@ -659,11 +659,10 @@ maildir_scan( maildir_store_t *ctx, msglist_t *msglist ) for (ru = u + 3; isdigit( (unsigned char)*ru ); ru++); else u = ru = strchr( entry->base, ':' ); - if (u) - ml = u - entry->base; - else - ru = "", ml = sizeof(buf); - fnl = nfsnprintf( buf + bl, sizeof(buf) - bl, "%s/%.*s,U=%d%s", subdirs[entry->recent], ml, entry->base, uid, ru ) + 1 - 4; + fnl = (u ? + nfsnprintf( buf + bl, sizeof(buf) - bl, "%s/%.*s,U=%d%s", subdirs[entry->recent], u - entry->base, entry->base, uid, ru ) : + nfsnprintf( buf + bl, sizeof(buf) - bl, "%s/%s,U=%d", subdirs[entry->recent], entry->base, uid )) + + 1 - 4; memcpy( nbuf, buf, bl + 4 ); nfsnprintf( nbuf + bl + 4, sizeof(nbuf) - bl - 4, "%s", entry->base ); if (rename( nbuf, buf )) {