[librsvg: 14/18] rsvg_acquire_gvfs_stream(): Don't resolve relative files here; we get passed a full URI



commit 69491d68d1081abe9cfa76dd94c5a6c2327d2636
Author: Federico Mena Quintero <federico gnome org>
Date:   Fri Nov 23 14:44:09 2018 -0600

    rsvg_acquire_gvfs_stream(): Don't resolve relative files here; we get passed a full URI

 librsvg/rsvg-handle.c |  1 -
 librsvg/rsvg-io.c     | 18 ++----------------
 librsvg/rsvg-io.h     |  1 -
 3 files changed, 2 insertions(+), 18 deletions(-)
---
diff --git a/librsvg/rsvg-handle.c b/librsvg/rsvg-handle.c
index 16cc2be2..61cea922 100644
--- a/librsvg/rsvg-handle.c
+++ b/librsvg/rsvg-handle.c
@@ -1703,7 +1703,6 @@ _rsvg_handle_acquire_stream (RsvgHandle *handle,
 
     if (allow_load (priv->base_gfile, uri, error)) {
         stream = _rsvg_io_acquire_stream (uri,
-                                          rsvg_handle_get_base_uri (handle),
                                           content_type,
                                           handle->priv->cancellable,
                                           error);
diff --git a/librsvg/rsvg-io.c b/librsvg/rsvg-io.c
index 5495ee7a..f07ee462 100644
--- a/librsvg/rsvg-io.c
+++ b/librsvg/rsvg-io.c
@@ -37,12 +37,11 @@ rsvg_decode_data_uri (const char *uri,
 
 static GInputStream *
 rsvg_acquire_gvfs_stream (const char *uri, 
-                          const char *base_uri, 
                           char **out_mime_type,
                           GCancellable *cancellable,
                           GError **error)
 {
-    GFile *base, *file;
+    GFile *file;
     GFileInputStream *stream;
     GError *err = NULL;
 
@@ -51,18 +50,6 @@ rsvg_acquire_gvfs_stream (const char *uri,
     stream = g_file_read (file, cancellable, &err);
     g_object_unref (file);
 
-    if (stream == NULL &&
-        g_error_matches (err, G_IO_ERROR, G_IO_ERROR_NOT_FOUND)) {
-        g_clear_error (&err);
-
-        base = g_file_new_for_uri (base_uri);
-        file = g_file_resolve_relative_path (base, uri);
-        g_object_unref (base);
-
-        stream = g_file_read (file, cancellable, &err);
-        g_object_unref (file);
-    }
-
     if (stream == NULL) {
         g_propagate_error (error, err);
         return NULL;
@@ -169,7 +156,6 @@ _rsvg_io_acquire_data (const char *uri,
 
 GInputStream *
 _rsvg_io_acquire_stream (const char *uri,
-                         const char *base_uri, 
                          char **mime_type,
                          GCancellable *cancellable,
                          GError **error)
@@ -191,7 +177,7 @@ _rsvg_io_acquire_stream (const char *uri,
         return g_memory_input_stream_new_from_data (data, len, (GDestroyNotify) g_free);
     }
 
-    if ((stream = rsvg_acquire_gvfs_stream (uri, base_uri, mime_type, cancellable, error)))
+    if ((stream = rsvg_acquire_gvfs_stream (uri, mime_type, cancellable, error)))
       return stream;
 
     return NULL;
diff --git a/librsvg/rsvg-io.h b/librsvg/rsvg-io.h
index 50e0002b..93400517 100644
--- a/librsvg/rsvg-io.h
+++ b/librsvg/rsvg-io.h
@@ -34,7 +34,6 @@ char *_rsvg_io_acquire_data (const char *uri,
                             GError **error);
 
 GInputStream *_rsvg_io_acquire_stream (const char *uri,
-                                       const char *base_uri,
                                        char **mime_type,
                                        GCancellable *cancellable,
                                        GError **error);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]