summaryrefslogtreecommitdiffstats
path: root/bcache.c
diff options
context:
space:
mode:
authorRocco Rutte <pdmef@gmx.net>2009-07-07 13:16:59 +0200
committerRocco Rutte <pdmef@gmx.net>2009-07-07 13:16:59 +0200
commitcccdcf841fe279dd3cc2aa7307965f1791b3cc25 (patch)
tree637cd726fde4a367dbcbeddec473510ebb4abe93 /bcache.c
parentf6d4088a71988bc1ef3d6e8194400f7fabf4712e (diff)
Make hcache+bcache paths always UTF-8. Closes #3284.
Diffstat (limited to 'bcache.c')
-rw-r--r--bcache.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/bcache.c b/bcache.c
index 81538d22..1ba5b727 100644
--- a/bcache.c
+++ b/bcache.c
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2006-7 Brendan Cully <brendan@kublai.com>
- * Copyright (C) 2006 Rocco Rutte <pdmef@gmx.net>
+ * Copyright (C) 2006, 2009 Rocco Rutte <pdmef@gmx.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -42,6 +42,7 @@ static int bcache_path(ACCOUNT *account, const char *mailbox,
char *dst, size_t dstlen)
{
char host[STRING];
+ char path[_POSIX_PATH_MAX];
ciss_url_t url;
int len;
@@ -62,12 +63,14 @@ static int bcache_path(ACCOUNT *account, const char *mailbox,
return -1;
}
- dprint (3, (debugfile, "bcache_path: URL: '%s'\n", host));
+ mutt_encode_path (path, sizeof (path), NONULL (mailbox));
len = snprintf (dst, dstlen-1, "%s/%s%s%s", MessageCachedir,
- host, NONULL(mailbox),
- (mailbox && *mailbox &&
- mailbox[mutt_strlen(mailbox) - 1] == '/') ? "" : "/");
+ host, NONULL (path),
+ (*path && path[mutt_strlen (path) - 1] == '/') ? "" : "/");
+
+ dprint (3, (debugfile, "bcache_path: rc: %d, path: '%s'\n", len, dst));
+
if (len < 0 || len >= dstlen-1)
return -1;