Commit 31ccf5ce 31ccf5ce42c695366b88e7b7d2eb8375949ff362 by Sergey Poznyakoff

(mailbox_folder_create): Do not try to select previous level if given a protocol…

… spec, other than `file:'
1 parent ff6875c7
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
22 22
23 #include <stdlib.h> 23 #include <stdlib.h>
24 #include <errno.h> 24 #include <errno.h>
25 #include <strdup.h>
25 26
26 #include <mailutils/debug.h> 27 #include <mailutils/debug.h>
27 #include <mailutils/errno.h> 28 #include <mailutils/errno.h>
...@@ -37,10 +38,11 @@ ...@@ -37,10 +38,11 @@
37 #include <mailutils/url.h> 38 #include <mailutils/url.h>
38 #include <mailutils/attribute.h> 39 #include <mailutils/attribute.h>
39 #include <mailutils/message.h> 40 #include <mailutils/message.h>
41 #include <mailutils/mutil.h>
40 42
41 #include <mailbox0.h> 43 #include <mailbox0.h>
42 44
43 int 45 static int
44 mailbox_folder_create (mu_folder_t *pfolder, const char *name) 46 mailbox_folder_create (mu_folder_t *pfolder, const char *name)
45 { 47 {
46 int rc; 48 int rc;
...@@ -48,9 +50,9 @@ mailbox_folder_create (mu_folder_t *pfolder, const char *name) ...@@ -48,9 +50,9 @@ mailbox_folder_create (mu_folder_t *pfolder, const char *name)
48 50
49 if (!fname) 51 if (!fname)
50 return ENOMEM; 52 return ENOMEM;
51 53
52 p = strrchr (fname, '/'); /* FIXME: Is this always appropriate? */ 54 p = strrchr (fname, '/'); /* FIXME: Is this always appropriate? */
53 if (p) 55 if (p && !(mu_is_proto (fname) && strncmp (p, "file:", 5)))
54 *p = 0; 56 *p = 0;
55 rc = mu_folder_create (pfolder, fname); 57 rc = mu_folder_create (pfolder, fname);
56 free (fname); 58 free (fname);
......