summaryrefslogtreecommitdiff
path: root/mail/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'mail/util.c')
-rw-r--r--mail/util.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/mail/util.c b/mail/util.c
index 8af140848..108b6b15d 100644
--- a/mail/util.c
+++ b/mail/util.c
@@ -1460,3 +1460,18 @@ util_rfc2047_decode (char **value)
}
}
+const char *
+util_url_to_string (mu_url_t url)
+{
+ const char *scheme;
+ if (mu_url_sget_scheme (url, &scheme) == 0)
+ {
+ if (strcmp (scheme, "file") == 0 || strcmp (scheme, "mbox") == 0)
+ {
+ const char *path;
+ if (mu_url_sget_path (url, &path) == 0)
+ return path;
+ }
+ }
+ return mu_url_to_string (url);
+}

Return to:

Send suggestions and report system problems to the System administrator.