From 863e55c70ecaa7376957eba6d72d5f875945f686 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 31 Mar 2003 20:02:59 +0000 Subject: [PATCH] - Fix uri search function where it would always return the last uriu function even if it was not a correct one. Original commit message from CVS: - Fix uri search function where it would always return the last uriu function even if it was not a correct one. - small comment cleanup to avoid problems with gtk-doc --- gst/gsturi.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/gst/gsturi.c b/gst/gsturi.c index e835cc9281..66957477de 100644 --- a/gst/gsturi.c +++ b/gst/gsturi.c @@ -138,7 +138,7 @@ gst_uri_handler_find (const gchar *name) return NULL; } -/** +/* * this is a straight copy from glib 2.2 * remove this function when glib 2.2 is sufficiently widespread and * then change to using the regular g_str_has_prefix @@ -170,23 +170,25 @@ GstURIHandler* gst_uri_handler_find_by_uri (const gchar *uri) { GList *walk, *orig; - GstURIHandler *handler = NULL; + GstURIHandler *result = NULL; g_return_val_if_fail (uri != NULL, NULL); orig = walk = gst_registry_pool_feature_list (GST_TYPE_URI_HANDLER); while (walk) { - handler = GST_URI_HANDLER (walk->data); + GstURIHandler *handler = GST_URI_HANDLER (walk->data); - if (g_str_has_prefix_glib22 ((gchar *) uri, handler->uri)) + if (g_str_has_prefix_glib22 ((gchar *) uri, handler->uri)) { + result = handler; break; + } walk = g_list_next (walk); } g_list_free (orig); - return handler; + return result; } /**