[libgsf] test-gio: make it optionally take a URL.



commit 685397e5acb7c688dc0e7bc7e12c08b7d657903b
Author: Morten Welinder <terra gnome org>
Date:   Thu Mar 6 17:29:31 2014 -0500

    test-gio: make it optionally take a URL.

 tests/test-gio.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/tests/test-gio.c b/tests/test-gio.c
index c89af23..0b14024 100644
--- a/tests/test-gio.c
+++ b/tests/test-gio.c
@@ -25,6 +25,7 @@
 #include <gsf/gsf-infile.h>
 #include <gsf/gsf-output-gio.h>
 #include <gsf/gsf-outfile.h>
+#include <string.h>
 
 static int
 test (char *argv[])
@@ -34,9 +35,10 @@ test (char *argv[])
        GError     *err = NULL;
        int         rval = 0;
 
-       input = gsf_input_gio_new_for_path (argv[1], &err);
+       input = strstr (argv[1], "://")
+               ? gsf_input_gio_new_for_uri (argv[1], &err)
+               : gsf_input_gio_new_for_path (argv[1], &err);
        if (input == NULL) {
-
                g_return_val_if_fail (err != NULL, 1);
 
                g_warning ("'%s' error: %s\n", argv[1], err->message);


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