summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>2002-12-11 15:20:21 +0000
committerThomas Roessler <roessler@does-not-exist.org>2002-12-11 15:20:21 +0000
commitd557f81e5396dd46e80daabbe2488138a53e4cef (patch)
tree28f32e3e19687a6b55bac687d55f22092560d18a /lib.c
parente9e1c6d1ac66ec32347103dfabfee7eba5c5dfde (diff)
Herbert Martin Dietze <herbert@the-little-red-haired-girl.org> notes
that mutt may currently build IMAP URLs like imap://exchange//herbert for FCCs. The fix in this patch is to include a function named mutt_concat_path which concatenates path elements, but avoids the creation of double slashes. (These don't create problems when you're just accessing the file system, but apparently thy do cause problems with IMAP.)
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib.c b/lib.c
index 6614ea37..e21f5612 100644
--- a/lib.c
+++ b/lib.c
@@ -622,3 +622,14 @@ void mutt_remove_trailing_ws (char *s)
for (p = s + mutt_strlen (s) - 1 ; p >= s && ISSPACE (*p) ; p--)
*p = 0;
}
+
+char *mutt_concat_path (char *d, const char *dir, const char *fname, size_t l)
+{
+ const char *fmt = "%s/%s";
+
+ if (!*fname || (*dir && dir[strlen(dir)-1] == '/'))
+ fmt = "%s%s";
+
+ snprintf (d, sizeof (d), fmt, dir, fname);
+ return d;
+}