From 16cd11ddf071d4b5783b8f85c3b86c5aebd759ff Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Mon, 17 Jul 2006 18:23:21 +0000 Subject: [PATCH] r4674: When reporting an invalid MIME type, include the type's name in the error message (Thomas Leonard). --- ROX-Filer/src/type.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ROX-Filer/src/type.c b/ROX-Filer/src/type.c index 914d2094..2dc2c182 100644 --- a/ROX-Filer/src/type.c +++ b/ROX-Filer/src/type.c @@ -185,7 +185,12 @@ static MIME_type *get_mime_type(const gchar *type_name, gboolean can_create) return mtype; slash = strchr(type_name, '/'); - g_return_val_if_fail(slash != NULL, NULL); /* XXX: Report nicely */ + if (slash == NULL) + { + g_warning("MIME type '%s' does not contain a '/' character!", + type_name); + return NULL; + } mtype = g_new(MIME_type, 1); mtype->media_type = g_strndup(type_name, slash - type_name); -- 2.11.4.GIT