[libgepub/wip/cosimoc/fixes: 3/8] doc: fix wrong path when looking for resources
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgepub/wip/cosimoc/fixes: 3/8] doc: fix wrong path when looking for resources
- Date: Sun, 12 Jun 2016 23:06:49 +0000 (UTC)
commit fddcda1b0d82247d3bbd9aa2a6066cd01f64d645
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Sun Jun 12 15:09:53 2016 -0700
doc: fix wrong path when looking for resources
The client will already pass the full path here. Don't try to mangle it
again.
libgepub/gepub-doc.c | 7 +------
1 files changed, 1 insertions(+), 6 deletions(-)
---
diff --git a/libgepub/gepub-doc.c b/libgepub/gepub-doc.c
index 001911f..a71f165 100644
--- a/libgepub/gepub-doc.c
+++ b/libgepub/gepub-doc.c
@@ -408,21 +408,16 @@ gepub_doc_get_resource_mime_by_id (GepubDoc *doc, gchar *id)
gchar *
gepub_doc_get_resource_mime (GepubDoc *doc, gchar *v)
{
- gchar *path = NULL;
GepubResource *gres;
GList *keys = g_hash_table_get_keys (doc->resources);
- path = g_strdup_printf ("%s%s", doc->content_base, v);
-
while (keys) {
gres = ((GepubResource*)g_hash_table_lookup (doc->resources, keys->data));
- if (!strcmp (gres->uri, path))
+ if (!strcmp (gres->uri, v))
break;
keys = keys->next;
}
- g_free(path);
-
if (keys)
return g_strdup (gres->mime);
else
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]