~loneowais/ubuntu/precise/rhythmbox/remember-the-rhythm

« back to all changes in this revision

Viewing changes to lib/rb-file-helpers.c

Tags: upstream-0.11.6svn20090209
ImportĀ upstreamĀ versionĀ 0.11.6svn20090209

Show diffs side-by-side

added added

removed removed

Lines of Context:
252
252
}
253
253
 
254
254
static gboolean
255
 
is_valid_scheme_character (char c)
256
 
{
257
 
        return g_ascii_isalnum (c) || c == '+' || c == '-' || c == '.';
258
 
}
259
 
 
260
 
 
261
 
 
262
 
 
263
 
static gboolean
264
 
has_valid_scheme (const char *uri)
265
 
{
266
 
        const char *p;
267
 
 
268
 
        p = uri;
269
 
 
270
 
        if (!is_valid_scheme_character (*p)) {
271
 
                return FALSE;
272
 
        }
273
 
 
274
 
        do {
275
 
                p++;
276
 
        } while (is_valid_scheme_character (*p));
277
 
 
278
 
        return *p == ':';
279
 
}
280
 
 
281
 
static gboolean
282
255
get_uri_perm (const char *uri, const char *perm_attribute)
283
256
{
284
257
        GFile *f;
749
722
char*
750
723
rb_uri_append_uri (const char *uri, const char *fragment)
751
724
{
752
 
        /* skip scheme component of the fragment */
753
 
        if (has_valid_scheme (fragment)) {
754
 
                while (is_valid_scheme_character (*fragment))
755
 
                        fragment++;
756
 
        }
757
 
        fragment++;
758
 
 
759
 
        return rb_uri_append_path (uri, fragment);
 
725
        char *path;
 
726
        char *rv;
 
727
        GFile *f = g_file_new_for_uri (fragment);
 
728
 
 
729
        path = g_file_get_path (f);
 
730
 
 
731
        rv = rb_uri_append_path (uri, path);
 
732
        g_free (path);
 
733
        g_object_unref (f);
 
734
 
 
735
        return rv;
760
736
}
761
737
 
762
738
char *